Lines Matching refs:len
59 pktcopy(osl_t *osh, void *p, uint offset, int len, uchar *buf) in pktcopy() argument
63 if (len < 0) in pktcopy()
64 len = 4096; /* "infinite" */ in pktcopy()
77 for (; p && len; p = PKTNEXT(osh, p)) { in pktcopy()
78 n = MIN((uint)PKTLEN(osh, p) - offset, (uint)len); in pktcopy()
81 len -= n; in pktcopy()
91 pktfrombuf(osl_t *osh, void *p, uint offset, int len, uchar *buf) in pktfrombuf() argument
106 for (; p && len; p = PKTNEXT(osh, p)) { in pktfrombuf()
107 n = MIN((uint)PKTLEN(osh, p) - offset, (uint)len); in pktfrombuf()
110 len -= n; in pktfrombuf()
125 int len; in pkttotlen() local
129 len = PKTLEN(osh, p); in pkttotlen()
130 total += len; in pkttotlen()
165 uint len, remain, align64; in pktsegcnt_war() local
169 len = PKTLEN(osh, p); in pktsegcnt_war()
170 if (len > 128) { in pktsegcnt_war()
173 if (((uintptr)pktdata & ~0x7ff) != ((uintptr)(pktdata+len) & ~0x7ff)) in pktsegcnt_war()
178 len -= align64; /* bytes from aligned 64B to end */ in pktsegcnt_war()
180 remain = len % 128; in pktsegcnt_war()
193 uint pkt_off = 0, len = 0; in pktdataoffset() local
201 pkt_off = offset - len; in pktdataoffset()
202 len += PKTLEN(osh, p); in pktdataoffset()
203 if (len > offset) in pktdataoffset()
215 uint len = 0; in pktoffset() local
221 len += PKTLEN(osh, p); in pktoffset()
222 if (len > offset) in pktoffset()
251 q->len++; in pktq_penq()
253 pq->len++; in pktq_penq()
279 q->len++; in pktq_penq_head()
281 pq->len++; in pktq_penq_head()
305 q->len--; in pktq_pdeq()
307 pq->len--; in pktq_pdeq()
330 q->len--; in pktq_pdeq_prev()
332 pq->len--; in pktq_pdeq_prev()
369 q->len--; in pktq_pdeq_with_fn()
371 pq->len--; in pktq_pdeq_with_fn()
400 q->len--; in pktq_pdeq_tail()
402 pq->len--; in pktq_pdeq_tail()
424 q->len--; in pktq_pflush()
425 pq->len--; in pktq_pflush()
434 ASSERT(q->len == 0); in pktq_pflush()
466 q->len--; in pktq_pdel()
467 pq->len--; in pktq_pdel()
506 if (pq->len == 0) in pktq_deq()
520 q->len--; in pktq_deq()
522 pq->len--; in pktq_deq()
539 if (pq->len == 0) in pktq_deq_tail()
560 q->len--; in pktq_deq_tail()
562 pq->len--; in pktq_deq_tail()
577 if (pq->len == 0) in pktq_peek()
594 if (pq->len == 0) in pktq_peek_tail()
615 if (pq->len == 0) { in pktq_flush()
622 ASSERT(pq->len == 0); in pktq_flush()
629 int prec, len; in pktq_mlen() local
631 len = 0; in pktq_mlen()
635 len += pq->q[prec].len; in pktq_mlen()
637 return len; in pktq_mlen()
648 if (pq->len == 0) in pktq_mpeek()
677 if (pq->len == 0) in pktq_mdeq()
695 q->len--; in pktq_mdeq()
700 pq->len--; in pktq_mdeq()
811 int len, nlen; in bcmstrstr() local
818 len = strlen(haystack) - nlen + 1; in bcmstrstr()
820 for (i = 0; i < len; i++) in bcmstrstr()
1232 bcm_iovar_lencheck(const bcm_iovar_t *vi, void *arg, int len, bool set) in bcm_iovar_lencheck() argument
1246 if (len < (int)sizeof(int)) { in bcm_iovar_lencheck()
1253 if (len < vi->minlen) { in bcm_iovar_lencheck()
1262 } else if (len) { in bcm_iovar_lencheck()
1518 uint len[CNBUFS]; in testcrc32() local
1528 len[j] = CLEN; in testcrc32()
1529 for (k = 0; k < len[j]; k++) in testcrc32()
1534 crcr = crc32(buf + j*CBUFSIZ + l, len[j], CRC32_INIT_VALUE); in testcrc32()
1555 int len; in bcm_next_tlv() local
1562 len = elt->len; in bcm_next_tlv()
1563 elt = (bcm_tlv_t*)(elt->data + len); in bcm_next_tlv()
1564 *buflen -= (TLV_HDR_LEN + len); in bcm_next_tlv()
1589 int len = elt->len; in bcm_parse_tlvs() local
1593 (totlen >= (len + TLV_HDR_LEN))) in bcm_parse_tlvs()
1596 elt = (bcm_tlv_t*)((uint8*)elt + (len + TLV_HDR_LEN)); in bcm_parse_tlvs()
1597 totlen -= (len + TLV_HDR_LEN); in bcm_parse_tlvs()
1621 int len = elt->len; in bcm_parse_ordered_tlvs() local
1629 (totlen >= (len + TLV_HDR_LEN))) in bcm_parse_ordered_tlvs()
1632 elt = (bcm_tlv_t*)((uint8*)elt + (len + TLV_HDR_LEN)); in bcm_parse_ordered_tlvs()
1633 totlen -= (len + TLV_HDR_LEN); in bcm_parse_ordered_tlvs()
1642 bcm_format_field(const bcm_bit_desc_ex_t *bd, uint32 flags, char* buf, int len) in bcm_format_field() argument
1648 if (len < 2 || !buf) in bcm_format_field()
1656 if (len > (int)strlen(name)) { in bcm_format_field()
1667 bcm_format_flags(const bcm_bit_desc_t *bd, uint32 flags, char* buf, int len) in bcm_format_flags() argument
1676 if (len < 2 || !buf) in bcm_format_flags()
1698 if (len <= slen) in bcm_format_flags()
1710 if (len < 2) in bcm_format_flags()
1711 p -= 2 - len; /* overwrite last char */ in bcm_format_flags()
1720 bcm_format_hex(char *str, const void *bytes, int len) in bcm_format_hex() argument
1726 for (i = 0; i < len; i++) { in bcm_format_hex()
1739 int len = sizeof(line); in prhex() local
1749 nchar = snprintf(p, len, " %04d: ", i); /* line prefix */ in prhex()
1751 len -= nchar; in prhex()
1753 if (len > 0) { in prhex()
1754 nchar = snprintf(p, len, "%02x ", buf[i]); in prhex()
1756 len -= nchar; in prhex()
1762 len = sizeof(line); in prhex()
1794 bcm_chipname(uint chipid, char *buf, uint len) in bcm_chipname() argument
1799 snprintf(buf, len, fmt, chipid); in bcm_chipname()
1821 uint len, max_len; in printbig() local
1824 len = strlen(buf); in printbig()
1828 while (len > max_len) { in printbig()
1835 len -= max_len; in printbig()
1848 int len; in bcmdumpfields() local
1857 len = snprintf(buf, bufsize, cur_ptr->nameandfmt, in bcmdumpfields()
1860 if (len < 0 || (uint32)len >= bufsize) in bcmdumpfields()
1861 len = bufsize - 1; in bcmdumpfields()
1862 buf += len; in bcmdumpfields()
1863 bufsize -= len; in bcmdumpfields()
1864 filled_len += len; in bcmdumpfields()
1873 uint len; in bcm_mkiovar() local
1875 len = strlen(name) + 1; in bcm_mkiovar()
1877 if ((len + datalen) > buflen) in bcm_mkiovar()
1883 memcpy(&buf[len], data, datalen); in bcm_mkiovar()
1884 len += datalen; in bcm_mkiovar()
1886 return len; in bcm_mkiovar()
2031 bcm_bprhex(struct bcmstrbuf *b, const char *msg, bool newline, uint8 *buf, int len) in bcm_bprhex() argument
2037 for (i = 0; i < len; i ++) in bcm_bprhex()
2069 bcm_print_bytes(const char *name, const uchar *data, int len) in bcm_print_bytes() argument
2074 printf("%s: %d \n", name ? name : "", len); in bcm_print_bytes()
2075 for (i = 0; i < len; i++) { in bcm_print_bytes()
2102 ie_len = ie->len; in find_vendor_ie()
2159 process_nvram_vars(char *varbuf, unsigned int len) in process_nvram_vars() argument
2172 for (n = 0; n < len; n++) { in process_nvram_vars()
2195 if (pad && (buf_len + pad <= len)) { in process_nvram_vars()