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

Commit 3fd79f7c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Staging: brcm80211: brcmfmac: 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 41feb5ed
Loading
Loading
Loading
Loading
+15 −15
Original line number Original line Diff line number Diff line
@@ -181,14 +181,14 @@ int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
	return BCME_UNSUPPORTED;
	return BCME_UNSUPPORTED;
}
}


uint8 bcmsdh_cfg_read(void *sdh, uint fnc_num, uint32 addr, int *err)
u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, uint32 addr, int *err)
{
{
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
	SDIOH_API_RC status;
	SDIOH_API_RC status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
	int32 retry = 0;
	int32 retry = 0;
#endif
#endif
	uint8 data = 0;
	u8 data = 0;


	if (!bcmsdh)
	if (!bcmsdh)
		bcmsdh = l_bcmsdh;
		bcmsdh = l_bcmsdh;
@@ -202,7 +202,7 @@ uint8 bcmsdh_cfg_read(void *sdh, uint fnc_num, uint32 addr, int *err)
#endif
#endif
		status =
		status =
		    sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr,
		    sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr,
				   (uint8 *) &data);
				   (u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
	} while (!SDIOH_API_SUCCESS(status)
	} while (!SDIOH_API_SUCCESS(status)
		 && (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT));
		 && (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT));
@@ -210,14 +210,14 @@ uint8 bcmsdh_cfg_read(void *sdh, uint fnc_num, uint32 addr, int *err)
	if (err)
	if (err)
		*err = (SDIOH_API_SUCCESS(status) ? 0 : BCME_SDIO_ERROR);
		*err = (SDIOH_API_SUCCESS(status) ? 0 : BCME_SDIO_ERROR);


	BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, uint8data = 0x%x\n",
	BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
		     __func__, fnc_num, addr, data));
		     __func__, fnc_num, addr, data));


	return data;
	return data;
}
}


void
void
bcmsdh_cfg_write(void *sdh, uint fnc_num, uint32 addr, uint8 data, int *err)
bcmsdh_cfg_write(void *sdh, uint fnc_num, uint32 addr, u8 data, int *err)
{
{
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
	SDIOH_API_RC status;
	SDIOH_API_RC status;
@@ -237,7 +237,7 @@ bcmsdh_cfg_write(void *sdh, uint fnc_num, uint32 addr, uint8 data, int *err)
#endif
#endif
		status =
		status =
		    sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr,
		    sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr,
				    (uint8 *) &data);
				    (u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
	} while (!SDIOH_API_SUCCESS(status)
	} while (!SDIOH_API_SUCCESS(status)
		 && (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT));
		 && (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT));
@@ -245,7 +245,7 @@ bcmsdh_cfg_write(void *sdh, uint fnc_num, uint32 addr, uint8 data, int *err)
	if (err)
	if (err)
		*err = SDIOH_API_SUCCESS(status) ? 0 : BCME_SDIO_ERROR;
		*err = SDIOH_API_SUCCESS(status) ? 0 : BCME_SDIO_ERROR;


	BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, uint8data = 0x%x\n",
	BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
		     __func__, fnc_num, addr, data));
		     __func__, fnc_num, addr, data));
}
}


@@ -296,13 +296,13 @@ bcmsdh_cfg_write_word(void *sdh, uint fnc_num, uint32 addr, uint32 data,
		     __func__, fnc_num, addr, data));
		     __func__, fnc_num, addr, data));
}
}


int bcmsdh_cis_read(void *sdh, uint func, uint8 * cis, uint length)
int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
{
{
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
	SDIOH_API_RC status;
	SDIOH_API_RC status;


	uint8 *tmp_buf, *tmp_ptr;
	u8 *tmp_buf, *tmp_ptr;
	uint8 *ptr;
	u8 *ptr;
	bool ascii = func & ~0xf;
	bool ascii = func & ~0xf;
	func &= 0x7;
	func &= 0x7;


@@ -318,7 +318,7 @@ int bcmsdh_cis_read(void *sdh, uint func, uint8 * cis, uint length)
	if (ascii) {
	if (ascii) {
		/* Move binary bits to tmp and format them
		/* Move binary bits to tmp and format them
			 into the provided buffer. */
			 into the provided buffer. */
		tmp_buf = (uint8 *) MALLOC(bcmsdh->osh, length);
		tmp_buf = (u8 *) MALLOC(bcmsdh->osh, length);
		if (tmp_buf == NULL) {
		if (tmp_buf == NULL) {
			BCMSDH_ERROR(("%s: out of memory\n", __func__));
			BCMSDH_ERROR(("%s: out of memory\n", __func__));
			return BCME_NOMEM;
			return BCME_NOMEM;
@@ -388,7 +388,7 @@ uint32 bcmsdh_reg_read(void *sdh, uint32 addr, uint size)
	/* if ok, return appropriately masked word */
	/* if ok, return appropriately masked word */
	if (SDIOH_API_SUCCESS(status)) {
	if (SDIOH_API_SUCCESS(status)) {
		switch (size) {
		switch (size) {
		case sizeof(uint8):
		case sizeof(u8):
			return word & 0xff;
			return word & 0xff;
		case sizeof(uint16):
		case sizeof(uint16):
			return word & 0xffff;
			return word & 0xffff;
@@ -452,7 +452,7 @@ bool bcmsdh_regfail(void *sdh)


int
int
bcmsdh_recv_buf(void *sdh, uint32 addr, uint fn, uint flags,
bcmsdh_recv_buf(void *sdh, uint32 addr, uint fn, uint flags,
		uint8 *buf, uint nbytes, void *pkt,
		u8 *buf, uint nbytes, void *pkt,
		bcmsdh_cmplt_fn_t complete, void *handle)
		bcmsdh_cmplt_fn_t complete, void *handle)
{
{
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
@@ -497,7 +497,7 @@ bcmsdh_recv_buf(void *sdh, uint32 addr, uint fn, uint flags,


int
int
bcmsdh_send_buf(void *sdh, uint32 addr, uint fn, uint flags,
bcmsdh_send_buf(void *sdh, uint32 addr, uint fn, uint flags,
		uint8 *buf, uint nbytes, void *pkt,
		u8 *buf, uint nbytes, void *pkt,
		bcmsdh_cmplt_fn_t complete, void *handle)
		bcmsdh_cmplt_fn_t complete, void *handle)
{
{
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
@@ -540,7 +540,7 @@ bcmsdh_send_buf(void *sdh, uint32 addr, uint fn, uint flags,
	return SDIOH_API_SUCCESS(status) ? 0 : BCME_ERROR;
	return SDIOH_API_SUCCESS(status) ? 0 : BCME_ERROR;
}
}


int bcmsdh_rwdata(void *sdh, uint rw, uint32 addr, uint8 *buf, uint nbytes)
int bcmsdh_rwdata(void *sdh, uint rw, uint32 addr, u8 *buf, uint nbytes)
{
{
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
	bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
	SDIOH_API_RC status;
	SDIOH_API_RC status;
+21 −21
Original line number Original line Diff line number Diff line
@@ -73,7 +73,7 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
{
{
	int err_ret;
	int err_ret;
	uint32 fbraddr;
	uint32 fbraddr;
	uint8 func;
	u8 func;


	sd_trace(("%s\n", __func__));
	sd_trace(("%s\n", __func__));


@@ -204,7 +204,7 @@ extern SDIOH_API_RC sdioh_detach(osl_t *osh, sdioh_info_t *sd)


extern SDIOH_API_RC sdioh_enable_func_intr(void)
extern SDIOH_API_RC sdioh_enable_func_intr(void)
{
{
	uint8 reg;
	u8 reg;
	int err;
	int err;


	if (gInstance->func[0]) {
	if (gInstance->func[0]) {
@@ -238,7 +238,7 @@ extern SDIOH_API_RC sdioh_enable_func_intr(void)


extern SDIOH_API_RC sdioh_disable_func_intr(void)
extern SDIOH_API_RC sdioh_disable_func_intr(void)
{
{
	uint8 reg;
	u8 reg;
	int err;
	int err;


	if (gInstance->func[0]) {
	if (gInstance->func[0]) {
@@ -649,7 +649,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
	case IOV_GVAL(IOV_DEVREG):
	case IOV_GVAL(IOV_DEVREG):
		{
		{
			sdreg_t *sd_ptr = (sdreg_t *) params;
			sdreg_t *sd_ptr = (sdreg_t *) params;
			uint8 data = 0;
			u8 data = 0;


			if (sdioh_cfg_read
			if (sdioh_cfg_read
			    (si, sd_ptr->func, sd_ptr->offset, &data)) {
			    (si, sd_ptr->func, sd_ptr->offset, &data)) {
@@ -665,7 +665,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
	case IOV_SVAL(IOV_DEVREG):
	case IOV_SVAL(IOV_DEVREG):
		{
		{
			sdreg_t *sd_ptr = (sdreg_t *) params;
			sdreg_t *sd_ptr = (sdreg_t *) params;
			uint8 data = (uint8) sd_ptr->value;
			u8 data = (u8) sd_ptr->value;


			if (sdioh_cfg_write
			if (sdioh_cfg_write
			    (si, sd_ptr->func, sd_ptr->offset, &data)) {
			    (si, sd_ptr->func, sd_ptr->offset, &data)) {
@@ -689,7 +689,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
SDIOH_API_RC sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
SDIOH_API_RC sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
{
{
	SDIOH_API_RC status;
	SDIOH_API_RC status;
	uint8 data;
	u8 data;


	if (enable)
	if (enable)
		data = 3;	/* enable hw oob interrupt */
		data = 3;	/* enable hw oob interrupt */
@@ -703,7 +703,7 @@ SDIOH_API_RC sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
#endif				/* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
#endif				/* defined(OOB_INTR_ONLY) && defined(HW_OOB) */


extern SDIOH_API_RC
extern SDIOH_API_RC
sdioh_cfg_read(sdioh_info_t *sd, uint fnc_num, uint32 addr, uint8 *data)
sdioh_cfg_read(sdioh_info_t *sd, uint fnc_num, uint32 addr, u8 *data)
{
{
	SDIOH_API_RC status;
	SDIOH_API_RC status;
	/* No lock needed since sdioh_request_byte does locking */
	/* No lock needed since sdioh_request_byte does locking */
@@ -712,7 +712,7 @@ sdioh_cfg_read(sdioh_info_t *sd, uint fnc_num, uint32 addr, uint8 *data)
}
}


extern SDIOH_API_RC
extern SDIOH_API_RC
sdioh_cfg_write(sdioh_info_t *sd, uint fnc_num, uint32 addr, uint8 *data)
sdioh_cfg_write(sdioh_info_t *sd, uint fnc_num, uint32 addr, u8 *data)
{
{
	/* No lock needed since sdioh_request_byte does locking */
	/* No lock needed since sdioh_request_byte does locking */
	SDIOH_API_RC status;
	SDIOH_API_RC status;
@@ -725,13 +725,13 @@ static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, uint32 regaddr)
	/* read 24 bits and return valid 17 bit addr */
	/* read 24 bits and return valid 17 bit addr */
	int i;
	int i;
	uint32 scratch, regdata;
	uint32 scratch, regdata;
	uint8 *ptr = (uint8 *)&scratch;
	u8 *ptr = (u8 *)&scratch;
	for (i = 0; i < 3; i++) {
	for (i = 0; i < 3; i++) {
		if ((sdioh_sdmmc_card_regread(sd, 0, regaddr, 1, &regdata)) !=
		if ((sdioh_sdmmc_card_regread(sd, 0, regaddr, 1, &regdata)) !=
		    SUCCESS)
		    SUCCESS)
			sd_err(("%s: Can't read!\n", __func__));
			sd_err(("%s: Can't read!\n", __func__));


		*ptr++ = (uint8) regdata;
		*ptr++ = (u8) regdata;
		regaddr++;
		regaddr++;
	}
	}


@@ -742,12 +742,12 @@ static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, uint32 regaddr)
}
}


extern SDIOH_API_RC
extern SDIOH_API_RC
sdioh_cis_read(sdioh_info_t *sd, uint func, uint8 *cisd, uint32 length)
sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, uint32 length)
{
{
	uint32 count;
	uint32 count;
	int offset;
	int offset;
	uint32 foo;
	uint32 foo;
	uint8 *cis = cisd;
	u8 *cis = cisd;


	sd_trace(("%s: Func = %d\n", __func__, func));
	sd_trace(("%s: Func = %d\n", __func__, func));


@@ -768,7 +768,7 @@ sdioh_cis_read(sdioh_info_t *sd, uint func, uint8 *cisd, uint32 length)
			return SDIOH_API_RC_FAIL;
			return SDIOH_API_RC_FAIL;
		}
		}


		*cis = (uint8) (foo & 0xff);
		*cis = (u8) (foo & 0xff);
		cis++;
		cis++;
	}
	}


@@ -777,7 +777,7 @@ sdioh_cis_read(sdioh_info_t *sd, uint func, uint8 *cisd, uint32 length)


extern SDIOH_API_RC
extern SDIOH_API_RC
sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
		   uint8 *byte)
		   u8 *byte)
{
{
	int err_ret;
	int err_ret;


@@ -967,19 +967,19 @@ sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,


		if ((write) && (!fifo)) {
		if ((write) && (!fifo)) {
			err_ret = sdio_memcpy_toio(gInstance->func[func], addr,
			err_ret = sdio_memcpy_toio(gInstance->func[func], addr,
						   ((uint8 *) PKTDATA(pnext)),
						   ((u8 *) PKTDATA(pnext)),
						   pkt_len);
						   pkt_len);
		} else if (write) {
		} else if (write) {
			err_ret = sdio_memcpy_toio(gInstance->func[func], addr,
			err_ret = sdio_memcpy_toio(gInstance->func[func], addr,
						   ((uint8 *) PKTDATA(pnext)),
						   ((u8 *) PKTDATA(pnext)),
						   pkt_len);
						   pkt_len);
		} else if (fifo) {
		} else if (fifo) {
			err_ret = sdio_readsb(gInstance->func[func],
			err_ret = sdio_readsb(gInstance->func[func],
					      ((uint8 *) PKTDATA(pnext)),
					      ((u8 *) PKTDATA(pnext)),
					      addr, pkt_len);
					      addr, pkt_len);
		} else {
		} else {
			err_ret = sdio_memcpy_fromio(gInstance->func[func],
			err_ret = sdio_memcpy_fromio(gInstance->func[func],
						     ((uint8 *) PKTDATA(pnext)),
						     ((u8 *) PKTDATA(pnext)),
						     addr, pkt_len);
						     addr, pkt_len);
		}
		}


@@ -1026,7 +1026,7 @@ sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
extern SDIOH_API_RC
extern SDIOH_API_RC
sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
		     uint func, uint addr, uint reg_width, uint buflen_u,
		     uint func, uint addr, uint reg_width, uint buflen_u,
		     uint8 *buffer, void *pkt)
		     u8 *buffer, void *pkt)
{
{
	SDIOH_API_RC Status;
	SDIOH_API_RC Status;
	void *mypkt = NULL;
	void *mypkt = NULL;
@@ -1160,7 +1160,7 @@ sdioh_sdmmc_card_regread(sdioh_info_t *sd, int func, uint32 regaddr,
{
{


	if ((func == 0) || (regsize == 1)) {
	if ((func == 0) || (regsize == 1)) {
		uint8 temp = 0;
		u8 temp = 0;


		sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
		sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
		*data = temp;
		*data = temp;
@@ -1226,7 +1226,7 @@ sdioh_sdmmc_card_regwrite(sdioh_info_t *sd, int func, uint32 regaddr,
{
{


	if ((func == 0) || (regsize == 1)) {
	if ((func == 0) || (regsize == 1)) {
		uint8 temp;
		u8 temp;


		temp = data & 0xff;
		temp = data & 0xff;
		sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
		sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
+29 −29
Original line number Original line Diff line number Diff line
@@ -158,7 +158,7 @@ void *pktq_penq(struct pktq *pq, int prec, void *p)
	pq->len++;
	pq->len++;


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


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


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


	return p;
	return p;
}
}
@@ -878,11 +878,11 @@ uint pktsetprio(void *pkt, bool update_vtag)
{
{
	struct ether_header *eh;
	struct ether_header *eh;
	struct ethervlan_header *evh;
	struct ethervlan_header *evh;
	uint8 *pktdata;
	u8 *pktdata;
	int priority = 0;
	int priority = 0;
	int rc = 0;
	int rc = 0;


	pktdata = (uint8 *) PKTDATA(pkt);
	pktdata = (u8 *) PKTDATA(pkt);
	ASSERT(ISALIGNED((uintptr) pktdata, sizeof(uint16)));
	ASSERT(ISALIGNED((uintptr) pktdata, sizeof(uint16)));


	eh = (struct ether_header *)pktdata;
	eh = (struct ether_header *)pktdata;
@@ -897,9 +897,9 @@ uint pktsetprio(void *pkt, bool update_vtag)
		vlan_prio = (int)(vlan_tag >> VLAN_PRI_SHIFT) & VLAN_PRI_MASK;
		vlan_prio = (int)(vlan_tag >> VLAN_PRI_SHIFT) & VLAN_PRI_MASK;


		if (ntoh16(evh->ether_type) == ETHER_TYPE_IP) {
		if (ntoh16(evh->ether_type) == ETHER_TYPE_IP) {
			uint8 *ip_body =
			u8 *ip_body =
			    pktdata + sizeof(struct ethervlan_header);
			    pktdata + sizeof(struct ethervlan_header);
			uint8 tos_tc = IP_TOS(ip_body);
			u8 tos_tc = IP_TOS(ip_body);
			dscp_prio = (int)(tos_tc >> IPV4_TOS_PREC_SHIFT);
			dscp_prio = (int)(tos_tc >> IPV4_TOS_PREC_SHIFT);
		}
		}


@@ -925,8 +925,8 @@ uint pktsetprio(void *pkt, bool update_vtag)
			rc |= PKTPRIO_UPD;
			rc |= PKTPRIO_UPD;
		}
		}
	} else if (ntoh16(eh->ether_type) == ETHER_TYPE_IP) {
	} else if (ntoh16(eh->ether_type) == ETHER_TYPE_IP) {
		uint8 *ip_body = pktdata + sizeof(struct ether_header);
		u8 *ip_body = pktdata + sizeof(struct ether_header);
		uint8 tos_tc = IP_TOS(ip_body);
		u8 tos_tc = IP_TOS(ip_body);
		priority = (int)(tos_tc >> IPV4_TOS_PREC_SHIFT);
		priority = (int)(tos_tc >> IPV4_TOS_PREC_SHIFT);
		rc |= PKTPRIO_DSCP;
		rc |= PKTPRIO_DSCP;
	}
	}
@@ -1049,7 +1049,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,
	0x00, 0xF7, 0xB9, 0x4E, 0x25, 0xD2, 0x9C, 0x6B,
	0x4A, 0xBD, 0xF3, 0x04, 0x6F, 0x98, 0xD6, 0x21,
	0x4A, 0xBD, 0xF3, 0x04, 0x6F, 0x98, 0xD6, 0x21,
	0x94, 0x63, 0x2D, 0xDA, 0xB1, 0x46, 0x08, 0xFF,
	0x94, 0x63, 0x2D, 0xDA, 0xB1, 0x46, 0x08, 0xFF,
@@ -1087,14 +1087,14 @@ STATIC const uint8 crc8_table[256] = {
#define CRC_INNER_LOOP(n, c, x) \
#define CRC_INNER_LOOP(n, c, x) \
	(c) = ((c) >> 8) ^ crc##n##_table[((c) ^ (x)) & 0xff]
	(c) = ((c) >> 8) ^ crc##n##_table[((c) ^ (x)) & 0xff]


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


uint16 hndcrc16(uint8 *pdata,	/* pointer to array of data to process */
uint16 hndcrc16(u8 *pdata,	/* pointer to array of data to process */
		uint nbytes,	/* number of input data bytes to process */
		uint nbytes,	/* number of input data bytes to process */
		uint16 crc	/* either CRC16_INIT_VALUE or previous
		uint16 crc	/* either CRC16_INIT_VALUE or previous
				 return value */
				 return value */
@@ -1237,19 +1237,19 @@ STATIC const uint32 crc32_table[256] = {
	0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
	0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
};
};


uint32 hndcrc32(uint8 *pdata,	/* pointer to array of data to process */
uint32 hndcrc32(u8 *pdata,	/* pointer to array of data to process */
		uint nbytes,	/* number of input data bytes to process */
		uint nbytes,	/* number of input data bytes to process */
		uint32 crc	/* either CRC32_INIT_VALUE or previous
		uint32 crc	/* either CRC32_INIT_VALUE or previous
					 return value */
					 return value */
)
)
{
{
	uint8 *pend;
	u8 *pend;
#ifdef __mips__
#ifdef __mips__
	uint8 tmp[4];
	u8 tmp[4];
	ulong *tptr = (ulong *) tmp;
	ulong *tptr = (ulong *) tmp;


	/* in case the beginning of the buffer isn't aligned */
	/* in case the beginning of the buffer isn't aligned */
	pend = (uint8 *) ((uint) (pdata + 3) & 0xfffffffc);
	pend = (u8 *) ((uint) (pdata + 3) & 0xfffffffc);
	nbytes -= (pend - pdata);
	nbytes -= (pend - pdata);
	while (pdata < pend)
	while (pdata < pend)
		CRC_INNER_LOOP(32, crc, *pdata++);
		CRC_INNER_LOOP(32, crc, *pdata++);
@@ -1286,7 +1286,7 @@ uint32 hndcrc32(uint8 *pdata, /* pointer to array of data to process */
void testcrc32(void)
void testcrc32(void)
{
{
	uint j, k, l;
	uint j, k, l;
	uint8 *buf;
	u8 *buf;
	uint len[CNBUFS];
	uint len[CNBUFS];
	uint32 crcr;
	uint32 crcr;
	uint32 crc32tv[CNBUFS] = {
	uint32 crc32tv[CNBUFS] = {
@@ -1365,7 +1365,7 @@ bcm_tlv_t *bcm_parse_tlvs(void *buf, int buflen, uint key)
		if ((elt->id == key) && (totlen >= (len + 2)))
		if ((elt->id == key) && (totlen >= (len + 2)))
			return elt;
			return elt;


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


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


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


	for (i = 0; i < len; i++) {
	for (i = 0; i < len; i++) {
		p += sprintf(p, "%02X", *src);
		p += sprintf(p, "%02X", *src);
@@ -1613,7 +1613,7 @@ static const uint16 nqdBm_to_mW_map[QDBM_TABLE_LEN] = {
/* 185: */ 42170, 44668, 47315, 50119, 53088, 56234, 59566, 63096
/* 185: */ 42170, 44668, 47315, 50119, 53088, 56234, 59566, 63096
};
};


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


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


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


	return qdbm;
	return qdbm;
}
}


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


@@ -1728,7 +1728,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;
	int i;


+10 −10
Original line number Original line Diff line number Diff line
@@ -101,7 +101,7 @@ typedef struct dhd_pub {
	uint hdrlen;		/* Total DHD header length (proto + bus) */
	uint hdrlen;		/* Total DHD header length (proto + bus) */
	uint maxctl;		/* Max size rxctl request from proto to bus */
	uint maxctl;		/* Max size rxctl request from proto to bus */
	uint rxsz;		/* Rx buffer size bus module should use */
	uint rxsz;		/* Rx buffer size bus module should use */
	uint8 wme_dp;		/* wme discard priority */
	u8 wme_dp;		/* wme discard priority */


	/* Dongle media info */
	/* Dongle media info */
	bool iswl;		/* Dongle-resident driver is wl */
	bool iswl;		/* Dongle-resident driver is wl */
@@ -153,7 +153,7 @@ typedef struct dhd_pub {
	char *pktfilter[100];
	char *pktfilter[100];
	int pktfilter_count;
	int pktfilter_count;


	uint8 country_code[WLC_CNTRY_BUF_SZ];
	u8 country_code[WLC_CNTRY_BUF_SZ];
	char eventmask[WL_EVENTING_MASK_LEN];
	char eventmask[WL_EVENTING_MASK_LEN];


#if defined(CONFIG_HAS_WAKELOCK)
#if defined(CONFIG_HAS_WAKELOCK)
@@ -277,10 +277,10 @@ static inline void WAKE_LOCK_DESTROY(dhd_pub_t *dhdp, int index)
}
}


typedef struct dhd_if_event {
typedef struct dhd_if_event {
	uint8 ifidx;
	u8 ifidx;
	uint8 action;
	u8 action;
	uint8 flags;
	u8 flags;
	uint8 bssidx;
	u8 bssidx;
} dhd_if_event_t;
} dhd_if_event_t;


/*
/*
@@ -348,7 +348,7 @@ extern void dhd_os_sdunlock_sndup_rxq(dhd_pub_t *pub);
extern void dhd_os_sdlock_eventq(dhd_pub_t *pub);
extern void dhd_os_sdlock_eventq(dhd_pub_t *pub);
extern void dhd_os_sdunlock_eventq(dhd_pub_t *pub);
extern void dhd_os_sdunlock_eventq(dhd_pub_t *pub);
#ifdef DHD_DEBUG
#ifdef DHD_DEBUG
extern int write_to_file(dhd_pub_t *dhd, uint8 *buf, int size);
extern int write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
#endif				/* DHD_DEBUG */
#endif				/* DHD_DEBUG */
#if defined(OOB_INTR_ONLY)
#if defined(OOB_INTR_ONLY)
extern int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr);
extern int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr);
@@ -369,7 +369,7 @@ extern void dhd_timeout_start(dhd_timeout_t *tmo, uint usec);
extern int dhd_timeout_expired(dhd_timeout_t *tmo);
extern int dhd_timeout_expired(dhd_timeout_t *tmo);


extern int dhd_ifname2idx(struct dhd_info *dhd, char *name);
extern int dhd_ifname2idx(struct dhd_info *dhd, char *name);
extern uint8 *dhd_bssidx2bssid(dhd_pub_t *dhd, int idx);
extern u8 *dhd_bssidx2bssid(dhd_pub_t *dhd, int idx);
extern int wl_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
extern int wl_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
			 wl_event_msg_t *, void **data_ptr);
			 wl_event_msg_t *, void **data_ptr);
extern void wl_event_to_host_order(wl_event_msg_t *evt);
extern void wl_event_to_host_order(wl_event_msg_t *evt);
@@ -377,7 +377,7 @@ extern void wl_event_to_host_order(wl_event_msg_t *evt);
extern void dhd_common_init(void);
extern void dhd_common_init(void);


extern int dhd_add_if(struct dhd_info *dhd, int ifidx, void *handle,
extern int dhd_add_if(struct dhd_info *dhd, int ifidx, void *handle,
		      char *name, uint8 *mac_addr, uint32 flags, uint8 bssidx);
		      char *name, u8 *mac_addr, uint32 flags, u8 bssidx);
extern void dhd_del_if(struct dhd_info *dhd, int ifidx);
extern void dhd_del_if(struct dhd_info *dhd, int ifidx);


extern void dhd_vif_add(struct dhd_info *dhd, int ifidx, char *name);
extern void dhd_vif_add(struct dhd_info *dhd, int ifidx, char *name);
@@ -393,7 +393,7 @@ extern int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, void *pkt);
/* Send event to host */
/* Send event to host */
extern void dhd_sendup_event(dhd_pub_t *dhdp, wl_event_msg_t *event,
extern void dhd_sendup_event(dhd_pub_t *dhdp, wl_event_msg_t *event,
			     void *data);
			     void *data);
extern int dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag);
extern int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag);
extern uint dhd_bus_status(dhd_pub_t *dhdp);
extern uint dhd_bus_status(dhd_pub_t *dhdp);
extern int dhd_bus_start(dhd_pub_t *dhdp);
extern int dhd_bus_start(dhd_pub_t *dhdp);


+4 −4
Original line number Original line Diff line number Diff line
@@ -53,9 +53,9 @@ extern int dhd_preinit_ioctls(dhd_pub_t *dhd);


typedef struct dhd_prot {
typedef struct dhd_prot {
	uint16 reqid;
	uint16 reqid;
	uint8 pending;
	u8 pending;
	uint32 lastcmd;
	uint32 lastcmd;
	uint8 bus_header[BUS_HEADER_LEN];
	u8 bus_header[BUS_HEADER_LEN];
	cdc_ioctl_t msg;
	cdc_ioctl_t msg;
	unsigned char buf[WLC_IOCTL_MAXLEN + ROUND_UP_MARGIN];
	unsigned char buf[WLC_IOCTL_MAXLEN + ROUND_UP_MARGIN];
} dhd_prot_t;
} dhd_prot_t;
@@ -285,7 +285,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
		slen = strlen("wme_dp") + 1;
		slen = strlen("wme_dp") + 1;
		if (len >= (int)(slen + sizeof(int)))
		if (len >= (int)(slen + sizeof(int)))
			bcopy(((char *)buf + slen), &val, sizeof(int));
			bcopy(((char *)buf + slen), &val, sizeof(int));
		dhd->wme_dp = (uint8) ltoh32(val);
		dhd->wme_dp = (u8) ltoh32(val);
	}
	}


	prot->pending = FALSE;
	prot->pending = FALSE;
@@ -334,7 +334,7 @@ void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, void *pktbuf)
	BDC_SET_IF_IDX(h, ifidx);
	BDC_SET_IF_IDX(h, ifidx);
}
}


bool dhd_proto_fcinfo(dhd_pub_t *dhd, void *pktbuf, uint8 * fcbits)
bool dhd_proto_fcinfo(dhd_pub_t *dhd, void *pktbuf, u8 * fcbits)
{
{
#ifdef BDC
#ifdef BDC
	struct bdc_header *h;
	struct bdc_header *h;
Loading