Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36ef9a1e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Staging: brcm80211: util: s/uint8/u8/



Replace uint8 with u8, the correct kernel type to be using here.

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Nohee Ko <noheek@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 42e5386d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -808,7 +808,7 @@ static int hndotp_nvread(void *oh, char *data, uint *len)
			/* Bad length, try to find another chunk anyway */
			rsz = 6;
		}
		if (hndcrc16((uint8 *) &rawotp[i], rsz,
		if (hndcrc16((u8 *) &rawotp[i], rsz,
			     CRC16_INIT_VALUE) == CRC16_GOOD_VALUE) {
			/* Good crc, copy the vars */
			gchunks++;
+22 −22
Original line number Diff line number Diff line
@@ -50,8 +50,8 @@

#define SROM_OFFSET(sih) ((sih->ccrev > 31) ? \
	(((sih->cccaps & CC_CAP_SROM) == 0) ? NULL : \
	 ((uint8 *)curmap + PCI_16KB0_CCREGS_OFFSET + CC_SROM_OTP)) : \
	((uint8 *)curmap + PCI_BAR0_SPROM_OFFSET))
	 ((u8 *)curmap + PCI_16KB0_CCREGS_OFFSET + CC_SROM_OTP)) : \
	((u8 *)curmap + PCI_BAR0_SPROM_OFFSET))

#if defined(BCMDBG)
#define WRITE_ENABLE_DELAY	500	/* 500 ms after write enable/disable toggle */
@@ -70,14 +70,14 @@ extern uint _varsz;

static int initvars_srom_si(si_t *sih, osl_t *osh, void *curmap, char **vars,
			    uint *count);
static void _initvars_srom_pci(uint8 sromrev, uint16 *srom, uint off,
static void _initvars_srom_pci(u8 sromrev, uint16 *srom, uint off,
			       varbuf_t *b);
static int initvars_srom_pci(si_t *sih, void *curmap, char **vars,
			     uint *count);
static int initvars_flash_si(si_t *sih, char **vars, uint *count);
#ifdef BCMSDIO
static int initvars_cis_sdio(osl_t *osh, char **vars, uint *count);
static int sprom_cmd_sdio(osl_t *osh, uint8 cmd);
static int sprom_cmd_sdio(osl_t *osh, u8 cmd);
static int sprom_read_sdio(osl_t *osh, uint16 addr, uint16 *data);
#endif				/* BCMSDIO */
static int sprom_read_pci(osl_t *osh, si_t *sih, uint16 *sprom, uint wordoff,
@@ -373,19 +373,19 @@ static const char BCMATTACHDATA(vstr_macaddr)[] = "macaddr=%s";
static const char BCMATTACHDATA(vstr_usbepnum)[] = "usbepnum=0x%x";
static const char BCMATTACHDATA(vstr_end)[] = "END\0";

uint8 patch_pair;
u8 patch_pair;

/* For dongle HW, accept partial calibration parameters */
#define BCMDONGLECASE(n)

int
BCMATTACHFN(srom_parsecis) (osl_t *osh, uint8 *pcis[], uint ciscnt,
BCMATTACHFN(srom_parsecis) (osl_t *osh, u8 *pcis[], uint ciscnt,
			    char **vars, uint *count)
{
	char eabuf[32];
	char *base;
	varbuf_t b;
	uint8 *cis, tup, tlen, sromrev = 1;
	u8 *cis, tup, tlen, sromrev = 1;
	int i, j;
	bool ag_init = FALSE;
	uint32 w32;
@@ -464,7 +464,7 @@ BCMATTACHFN(srom_parsecis) (osl_t *osh, uint8 *pcis[], uint ciscnt,
				case CISTPL_FID_SDIO:
#ifdef BCMSDIO
					if (cis[i] == 0) {
						uint8 spd = cis[i + 3];
						u8 spd = cis[i + 3];
						static int base[] = {
							-1, 10, 12, 13, 15, 20,
							    25, 30,
@@ -1337,7 +1337,7 @@ BCMATTACHFN(srom_parsecis) (osl_t *osh, uint8 *pcis[], uint ciscnt,
				case HNBU_SROM3SWRGN:
					if (tlen >= 73) {
						uint16 srom[35];
						uint8 srev = cis[i + 1 + 70];
						u8 srev = cis[i + 1 + 70];
						ASSERT(srev == 3);
						/* make tuple value 16-bit aligned and parse it */
						bcopy(&cis[i + 1], srom,
@@ -1462,7 +1462,7 @@ sprom_read_pci(osl_t *osh, si_t *sih, uint16 *sprom, uint wordoff,
			if ((sih->cccaps & CC_CAP_SROM) == 0)
				return 1;

			ccregs = (void *)((uint8 *) sprom - CC_SROM_OTP);
			ccregs = (void *)((u8 *) sprom - CC_SROM_OTP);
			buf[i] =
			    srom_cc_cmd(sih, osh, ccregs, SRC_OP_READ,
					wordoff + i, 0);
@@ -1494,7 +1494,7 @@ sprom_read_pci(osl_t *osh, si_t *sih, uint16 *sprom, uint wordoff,

		/* fixup the endianness so crc8 will pass */
		htol16_buf(buf, nwords * 2);
		if (hndcrc8((uint8 *) buf, nwords * 2, CRC8_INIT_VALUE) !=
		if (hndcrc8((u8 *) buf, nwords * 2, CRC8_INIT_VALUE) !=
		    CRC8_GOOD_VALUE) {
			/* DBG only pci always read srom4 first, then srom8/9 */
			/* BS_ERROR(("%s: bad crc\n", __func__)); */
@@ -1509,7 +1509,7 @@ sprom_read_pci(osl_t *osh, si_t *sih, uint16 *sprom, uint wordoff,
#if defined(BCMNVRAMR)
static int otp_read_pci(osl_t *osh, si_t *sih, uint16 *buf, uint bufsz)
{
	uint8 *otp;
	u8 *otp;
	uint sz = OTP_SZ_MAX / 2;	/* size in words */
	int err = 0;

@@ -1542,7 +1542,7 @@ static int otp_read_pci(osl_t *osh, si_t *sih, uint16 *buf, uint bufsz)

	/* fixup the endianness so crc8 will pass */
	htol16_buf(buf, bufsz);
	if (hndcrc8((uint8 *) buf, SROM4_WORDS * 2, CRC8_INIT_VALUE) !=
	if (hndcrc8((u8 *) buf, SROM4_WORDS * 2, CRC8_INIT_VALUE) !=
	    CRC8_GOOD_VALUE) {
		BS_ERROR(("%s: bad crc\n", __func__));
		err = 1;
@@ -1705,7 +1705,7 @@ static bool mask_valid(uint16 mask)
#endif				/* BCMDBG */

static void
BCMATTACHFN(_initvars_srom_pci) (uint8 sromrev, uint16 *srom, uint off,
BCMATTACHFN(_initvars_srom_pci) (u8 sromrev, uint16 *srom, uint off,
				 varbuf_t *b) {
	uint16 w;
	uint32 val;
@@ -1857,7 +1857,7 @@ static int
BCMATTACHFN(initvars_srom_pci) (si_t *sih, void *curmap, char **vars,
				uint *count) {
	uint16 *srom, *sromwindow;
	uint8 sromrev = 0;
	u8 sromrev = 0;
	uint32 sr;
	varbuf_t b;
	char *vp, *base = NULL;
@@ -1927,7 +1927,7 @@ BCMATTACHFN(initvars_srom_pci) (si_t *sih, void *curmap, char **vars,

		value = si_getdevpathvar(sih, "sromrev");
		if (value) {
			sromrev = (uint8) simple_strtoul(value, NULL, 0);
			sromrev = (u8) simple_strtoul(value, NULL, 0);
			flash = TRUE;
			goto varscont;
		}
@@ -2005,7 +2005,7 @@ BCMATTACHFN(initvars_srom_pci) (si_t *sih, void *curmap, char **vars,
static int
BCMATTACHFN(initvars_cis_sdio) (osl_t *osh, char **vars, uint *count)
{
	uint8 *cis[SBSDIO_NUM_FUNCTION + 1];
	u8 *cis[SBSDIO_NUM_FUNCTION + 1];
	uint fn, numfn;
	int rc = 0;

@@ -2039,9 +2039,9 @@ BCMATTACHFN(initvars_cis_sdio) (osl_t *osh, char **vars, uint *count)
}

/* set SDIO sprom command register */
static int BCMATTACHFN(sprom_cmd_sdio) (osl_t *osh, uint8 cmd)
static int BCMATTACHFN(sprom_cmd_sdio) (osl_t *osh, u8 cmd)
{
	uint8 status = 0;
	u8 status = 0;
	uint wait_cnt = 1000;

	/* write sprom command register */
@@ -2061,10 +2061,10 @@ static int BCMATTACHFN(sprom_cmd_sdio) (osl_t *osh, uint8 cmd)
/* read a word from the SDIO srom */
static int sprom_read_sdio(osl_t *osh, uint16 addr, uint16 *data)
{
	uint8 addr_l, addr_h, data_l, data_h;
	u8 addr_l, addr_h, data_l, data_h;

	addr_l = (uint8) ((addr * 2) & 0xff);
	addr_h = (uint8) (((addr * 2) >> 8) & 0xff);
	addr_l = (u8) ((addr * 2) & 0xff);
	addr_h = (u8) (((addr * 2) >> 8) & 0xff);

	/* set address */
	bcmsdh_cfg_write(NULL, SDIO_FUNC_1, SBSDIO_SPROM_ADDR_HIGH, addr_h,
+22 −22
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ void *BCMFASTPATH pktq_penq(struct pktq *pq, int prec, void *p)
	pq->len++;

	if (pq->hi_prec < prec)
		pq->hi_prec = (uint8) prec;
		pq->hi_prec = (u8) prec;

	return p;
}
@@ -181,7 +181,7 @@ void *BCMFASTPATH pktq_penq_head(struct pktq *pq, int prec, void *p)
	pq->len++;

	if (pq->hi_prec < prec)
		pq->hi_prec = (uint8) prec;
		pq->hi_prec = (u8) prec;

	return p;
}
@@ -567,7 +567,7 @@ int getintvar(char *vars, const char *name)
	return simple_strtoul(val, NULL, 0);
}

int getintvararray(char *vars, const char *name, uint8 index)
int getintvararray(char *vars, const char *name, u8 index)
{
	char *buf, *endp;
	int i = 0;
@@ -855,7 +855,7 @@ int bcm_iovar_lencheck(const bcm_iovar_t *vi, void *arg, int len, bool set)
 * ****************************************************************************
 */

static const uint8 crc8_table[256] = {
static const u8 crc8_table[256] = {
	0x00, 0xF7, 0xB9, 0x4E, 0x25, 0xD2, 0x9C, 0x6B,
	0x4A, 0xBD, 0xF3, 0x04, 0x6F, 0x98, 0xD6, 0x21,
	0x94, 0x63, 0x2D, 0xDA, 0xB1, 0x46, 0x08, 0xFF,
@@ -893,12 +893,12 @@ static const uint8 crc8_table[256] = {
#define CRC_INNER_LOOP(n, c, x) \
	((c) = ((c) >> 8) ^ crc##n##_table[((c) ^ (x)) & 0xff])

uint8 BCMROMFN(hndcrc8) (uint8 *pdata,	/* pointer to array of data to process */
u8 BCMROMFN(hndcrc8) (u8 *pdata,	/* pointer to array of data to process */
			 uint nbytes,	/* number of input data bytes to process */
			 uint8 crc	/* either CRC8_INIT_VALUE or previous return value */
			 u8 crc	/* either CRC8_INIT_VALUE or previous return value */
    ) {
	/* hard code the crc loop instead of using CRC_INNER_LOOP macro
	 * to avoid the undefined and unnecessary (uint8 >> 8) operation.
	 * to avoid the undefined and unnecessary (u8 >> 8) operation.
	 */
	while (nbytes-- > 0)
		crc = crc8_table[(crc ^ *pdata++) & 0xff];
@@ -963,7 +963,7 @@ static const uint16 crc16_table[256] = {
	0x7BC7, 0x6A4E, 0x58D5, 0x495C, 0x3DE3, 0x2C6A, 0x1EF1, 0x0F78
};

uint16 BCMROMFN(hndcrc16) (uint8 *pdata,	/* pointer to array of data to process */
uint16 BCMROMFN(hndcrc16) (u8 *pdata,	/* pointer to array of data to process */
			   uint nbytes,	/* number of input data bytes to process */
			   uint16 crc	/* either CRC16_INIT_VALUE or previous return value */
    ) {
@@ -1021,7 +1021,7 @@ bcm_tlv_t *BCMROMFN(bcm_parse_tlvs) (void *buf, int buflen, uint key)
		if ((elt->id == key) && (totlen >= (len + 2)))
			return elt;

		elt = (bcm_tlv_t *) ((uint8 *) elt + (len + 2));
		elt = (bcm_tlv_t *) ((u8 *) elt + (len + 2));
		totlen -= (len + 2);
	}

@@ -1055,7 +1055,7 @@ bcm_tlv_t *BCMROMFN(bcm_parse_ordered_tlvs) (void *buf, int buflen, uint key)
		if ((id == key) && (totlen >= (len + 2)))
			return elt;

		elt = (bcm_tlv_t *) ((uint8 *) elt + (len + 2));
		elt = (bcm_tlv_t *) ((u8 *) elt + (len + 2));
		totlen -= (len + 2);
	}
	return NULL;
@@ -1120,7 +1120,7 @@ int bcm_format_hex(char *str, const void *bytes, int len)
{
	int i;
	char *p = str;
	const uint8 *src = (const uint8 *)bytes;
	const u8 *src = (const u8 *)bytes;

	for (i = 0; i < len; i++) {
		p += snprintf(p, 3, "%02X", *src);
@@ -1187,11 +1187,11 @@ const char *bcm_crypto_algo_name(uint algo)
#ifdef BCMDBG
void deadbeef(void *p, uint len)
{
	static uint8 meat[] = { 0xde, 0xad, 0xbe, 0xef };
	static u8 meat[] = { 0xde, 0xad, 0xbe, 0xef };

	while (len-- > 0) {
		*(uint8 *) p = meat[((uintptr) p) & 3];
		p = (uint8 *) p + 1;
		*(u8 *) p = meat[((uintptr) p) & 3];
		p = (u8 *) p + 1;
	}
}
#endif				/* BCMDBG */
@@ -1318,7 +1318,7 @@ static const uint16 nqdBm_to_mW_map[QDBM_TABLE_LEN] = {
/* 185: */ 42170, 44668, 47315, 50119, 53088, 56234, 59566, 63096
};

uint16 BCMROMFN(bcm_qdbm_to_mw) (uint8 qdbm)
uint16 BCMROMFN(bcm_qdbm_to_mw) (u8 qdbm)
{
	uint factor = 1;
	int idx = qdbm - QDBM_OFFSET;
@@ -1342,9 +1342,9 @@ uint16 BCMROMFN(bcm_qdbm_to_mw) (uint8 qdbm)
	return (nqdBm_to_mW_map[idx] + factor / 2) / factor;
}

uint8 BCMROMFN(bcm_mw_to_qdbm) (uint16 mw)
u8 BCMROMFN(bcm_mw_to_qdbm) (uint16 mw)
{
	uint8 qdbm;
	u8 qdbm;
	int offset;
	uint mw_uint = mw;
	uint boundary;
@@ -1368,15 +1368,15 @@ uint8 BCMROMFN(bcm_mw_to_qdbm) (uint16 mw)
			break;
	}

	qdbm += (uint8) offset;
	qdbm += (u8) offset;

	return qdbm;
}

uint BCMROMFN(bcm_bitcount) (uint8 *bitmap, uint length)
uint BCMROMFN(bcm_bitcount) (u8 *bitmap, uint length)
{
	uint bitcount = 0, i;
	uint8 tmp;
	u8 tmp;
	for (i = 0; i < length; i++) {
		tmp = bitmap[i];
		while (tmp) {
@@ -1419,7 +1419,7 @@ int bcm_bprintf(struct bcmstrbuf *b, const char *fmt, ...)
	return r;
}

void bcm_inc_bytes(uchar *num, int num_bytes, uint8 amount)
void bcm_inc_bytes(uchar *num, int num_bytes, u8 amount)
{
	int i;

@@ -1431,7 +1431,7 @@ void bcm_inc_bytes(uchar *num, int num_bytes, uint8 amount)
	}
}

int bcm_cmp_bytes(uchar *arg1, uchar *arg2, uint8 nbytes)
int bcm_cmp_bytes(uchar *arg1, uchar *arg2, u8 nbytes)
{
	int i;

+3 −3
Original line number Diff line number Diff line
@@ -180,9 +180,9 @@ bool wf_chspec_malformed(chanspec_t chanspec)
 * channels this is just the channel number, for 40MHZ channels it is the upper or lowre 20MHZ
 * sideband depending on the chanspec selected
 */
uint8 wf_chspec_ctlchan(chanspec_t chspec)
u8 wf_chspec_ctlchan(chanspec_t chspec)
{
	uint8 ctl_chan;
	u8 ctl_chan;

	/* Is there a sideband ? */
	if (CHSPEC_CTL_SB(chspec) == WL_CHANSPEC_CTL_SB_NONE) {
@@ -210,7 +210,7 @@ uint8 wf_chspec_ctlchan(chanspec_t chspec)
chanspec_t wf_chspec_ctlchspec(chanspec_t chspec)
{
	chanspec_t ctl_chspec = 0;
	uint8 channel;
	u8 channel;

	ASSERT(!wf_chspec_malformed(chspec));

+3 −3
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
/* Is this body of this tlvs entry a WFA entry? If
 * not update the tlvs buffer pointer/length.
 */
bool bcm_is_wfa_ie(uint8 *ie, uint8 **tlvs, uint *tlvs_len, uint8 type)
bool bcm_is_wfa_ie(u8 *ie, u8 **tlvs, uint *tlvs_len, u8 type)
{
	/* If the contents match the WFA_OUI and type */
	if ((ie[TLV_LEN_OFF] > (WFA_OUI_LEN + 1)) &&
@@ -43,12 +43,12 @@ bool bcm_is_wfa_ie(uint8 *ie, uint8 **tlvs, uint *tlvs_len, uint8 type)
	return FALSE;
}

wpa_ie_fixed_t *BCMROMFN(bcm_find_wpaie) (uint8 * parse, uint len)
wpa_ie_fixed_t *BCMROMFN(bcm_find_wpaie) (u8 * parse, uint len)
{
	bcm_tlv_t *ie;

	while ((ie = bcm_parse_tlvs(parse, len, DOT11_MNG_VS_ID))) {
		if (bcm_is_wpa_ie((uint8 *) ie, &parse, &len)) {
		if (bcm_is_wpa_ie((u8 *) ie, &parse, &len)) {
			return (wpa_ie_fixed_t *) ie;
		}
	}
Loading