oi = (otpinfo_t *) oh;
- ASSERT(wn < oi->wsize);
- ASSERT(cc != NULL);
-
return R_REG(&cc->sromotp[wn]);
}
ret = osizew * 2 - OTP_SZ_FU_72 - OTP_SZ_CHECKSUM;
break;
default:
- ASSERT(0); /* Don't know about this chip */
+ break; /* Don't know about this chip */
}
return ret;
otpinfo_t *oi;
/* Make sure we're running IPX OTP */
- ASSERT(OTPTYPE_IPX(sih->ccrev));
if (!OTPTYPE_IPX(sih->ccrev))
return NULL;
/* Retrieve OTP region info */
idx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX);
- ASSERT(cc != NULL);
_ipxotp_init(oi, cc);
idx = si_coreidx(oi->sih);
cc = si_setcoreidx(oi->sih, SI_CC_IDX);
- ASSERT(cc != NULL);
/* Read the data */
for (i = 0; i < sz; i++)
static u16 hndotp_otpr(void *oh, chipcregs_t *cc, uint wn)
{
-#ifdef BCMDBG
- otpinfo_t *oi = (otpinfo_t *) oh;
-#endif
volatile u16 *ptr;
- ASSERT(wn < ((oi->size / 2) + OTP_RC_LIM_OFF));
- ASSERT(cc != NULL);
-
ptr = (volatile u16 *)((volatile char *)cc + CC_SROM_OTP);
return R_REG(&ptr[wn]);
}
otpinfo_t *oi = (otpinfo_t *) oh;
volatile u16 *ptr;
- ASSERT(woff >= (-((int)oi->size / 2)));
- ASSERT(woff < OTP_LIM_OFF);
- ASSERT(cc != NULL);
-
ptr = (volatile u16 *)((volatile char *)cc + CC_SROM_OTP);
return R_REG(&ptr[(oi->size / 2) + woff]);
goto out;
}
- /* As of right now, support only 4320a2, 4311a1 and 4312 */
- ASSERT((oi->ccrev == 12) || (oi->ccrev == 17)
- || (oi->ccrev == 22));
- if (!
- ((oi->ccrev == 12) || (oi->ccrev == 17)
+ if (!((oi->ccrev == 12) || (oi->ccrev == 17)
|| (oi->ccrev == 22)))
return NULL;
chipcregs_t *cc;
int i;
- /* Only support HW region (no active chips use HND OTP SW region) */
- ASSERT(region == OTP_HW_REGION);
+
+ if (region != OTP_HW_REGION) {
+ /*
+ * Only support HW region
+ * (no active chips use HND OTP SW region)
+ * */
+ return -ENOTSUPP;
+ }
/* Region empty? */
st = oi->hwprot | oi->signvalid;
idx = si_coreidx(oi->sih);
cc = si_setcoreidx(oi->sih, SI_CC_IDX);
- ASSERT(cc != NULL);
for (i = 0; i < (int)*wlen; i++)
data[i] = hndotp_otpr(oh, cc, i);
/* save the orig core */
idx = si_coreidx(oi->sih);
cc = si_setcoreidx(oi->sih, SI_CC_IDX);
- ASSERT(cc != NULL);
st = hndotp_status(oh);
if (!(st & (OTP_HW_REGION | OTP_SW_REGION))) {
len = 0;
- ASSERT(bustype == bustype);
if (vars == NULL || count == NULL)
return 0;
return initvars_srom_si(sih, curmap, vars, count);
case PCI_BUS:
- ASSERT(curmap != NULL);
if (curmap == NULL)
return -1;
return initvars_srom_pci(sih, curmap, vars, count);
default:
- ASSERT(0);
+ break;
}
return -1;
}
uint sz = OTP_SZ_MAX / 2; /* size in words */
int err = 0;
- ASSERT(bufsz <= OTP_SZ_MAX);
-
otp = kzalloc(OTP_SZ_MAX, GFP_ATOMIC);
if (otp == NULL) {
return -EBADE;
/* do it only when there is more than just the null string */
if (c > 1) {
char *vp = kmalloc(c, GFP_ATOMIC);
- ASSERT(vp != NULL);
if (!vp)
return -ENOMEM;
memcpy(vp, start, c);
char *vp, *base;
int err;
- ASSERT(vars != NULL);
- ASSERT(count != NULL);
-
base = vp = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
- ASSERT(vp != NULL);
if (!vp)
return -ENOMEM;
if (mask & (1 << i))
return i;
}
- ASSERT(mask);
return 0;
}
if (mask & (1 << i))
return (uint) (i - mask_shift(mask) + 1);
}
- ASSERT(mask);
return 0;
}
-#if defined(BCMDBG)
-static bool mask_valid(u16 mask)
-{
- uint shift = mask_shift(mask);
- uint width = mask_width(mask);
- return mask == ((~0 << shift) & ~(~0 << (shift + width)));
-}
-#endif /* BCMDBG */
-
static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off, varbuf_t *b)
{
u16 w;
varbuf_append(b, "%s=%pM", name, ea);
} else {
- ASSERT(mask_valid(srv->mask));
- ASSERT(mask_width(srv->mask));
-
w = srom[srv->off - off];
val = (w & srv->mask) >> mask_shift(srv->mask);
width = mask_width(srv->mask);
while (srv->flags & SRFL_MORE) {
srv++;
- ASSERT(srv->name != NULL);
-
if (srv->off == 0 || srv->off < off)
continue;
- ASSERT(mask_valid(srv->mask));
- ASSERT(mask_width(srv->mask));
-
w = srom[srv->off - off];
val +=
((w & srv->mask) >> mask_shift(srv->
continue;
w = srom[pb + srv->off - off];
-
- ASSERT(mask_valid(srv->mask));
val = (w & srv->mask) >> mask_shift(srv->mask);
width = mask_width(srv->mask);
* from flash.
*/
srom = kmalloc(SROM_MAX, GFP_ATOMIC);
- ASSERT(srom != NULL);
if (!srom)
return -2;
goto errout;
}
- ASSERT(vars != NULL);
- ASSERT(count != NULL);
-
base = vp = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
- ASSERT(vp != NULL);
if (!vp) {
err = -2;
goto errout;
_initvars_srom_pci(sromrev, srom, 0, &b);
/* final nullbyte terminator */
- ASSERT(b.size >= 1);
vp = b.buf;
*vp++ = '\0';
- ASSERT((vp - base) <= MAXSZ_NVRAM_VARS);
-
varsdone:
err = initvars_table(base, vp, vars, count);
struct sk_buff *nskb;
int nest = 0;
- ASSERT(skb);
-
/* perversion: we use skb->next to chain multi-skb packets */
while (skb) {
nskb = skb->next;
{
struct pktq_prec *q;
- ASSERT(prec >= 0 && prec < pq->num_prec);
- ASSERT(p->prev == NULL); /* queueing chains not allowed */
-
- ASSERT(!pktq_full(pq));
- ASSERT(!pktq_pfull(pq, prec));
+ if (pktq_full(pq) || pktq_pfull(pq, prec))
+ return NULL;
q = &pq->q[prec];
{
struct pktq_prec *q;
- ASSERT(prec >= 0 && prec < pq->num_prec);
- ASSERT(p->prev == NULL); /* queueing chains not allowed */
-
- ASSERT(!pktq_full(pq));
- ASSERT(!pktq_pfull(pq, prec));
+ if (pktq_full(pq) || pktq_pfull(pq, prec))
+ return NULL;
q = &pq->q[prec];
struct pktq_prec *q;
struct sk_buff *p;
- ASSERT(prec >= 0 && prec < pq->num_prec);
-
q = &pq->q[prec];
p = q->head;
struct pktq_prec *q;
struct sk_buff *p, *prev;
- ASSERT(prec >= 0 && prec < pq->num_prec);
-
q = &pq->q[prec];
p = q->head;
pq->len--;
p = q->head;
}
- ASSERT(q->len == 0);
q->tail = NULL;
}
int prec;
for (prec = 0; prec < pq->num_prec; prec++)
pktq_pflush(pq, prec, dir);
- ASSERT(pq->len == 0);
}
#else /* !BRCM_FULLMAC */
void
}
if (q->head == NULL) {
- ASSERT(q->len == 0);
q->tail = NULL;
}
}
else
lookup_name = name;
- ASSERT(table != NULL);
-
for (vi = table; vi->name; vi++) {
if (!strcmp(vi->name, lookup_name))
return vi;
default:
/* unknown type for length check in iovar info */
- ASSERT(0);
bcmerror = -ENOTSUPP;
}