Commit 2f6b1dde authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman
Browse files

staging: brcm80211: got rid of several void pointers in softmac



Code cleanup. Replaced void pointers by less generic pointer types.

Reported-by: default avatarJulian Calaby <julian.calaby@gmail.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e45e8698
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -109,7 +109,6 @@ struct brcms_fifo_info {
 * rx_factor: maximum rx ampdu factor (0-3) ==> 2^(13+x) bytes
 * ffpld_rsvd: number of bytes to reserve for preload
 * max_txlen: max size of ampdu per mcs, bw and sgi
 * ini_free: array of ini's to be freed on detach
 * mfbr: enable multiple fallback rate
 * tx_max_funl: underflows should be kept such that
 *		(tx_max_funfl*underflows) < tx frames
@@ -132,7 +131,6 @@ struct ampdu_info {
	u8 rx_factor;
	u32 ffpld_rsvd;
	u32 max_txlen[MCS_TABLE_SIZE][2][2];
	void *ini_free[AMPDU_INI_FREE];
	bool mfbr;
	u32 tx_max_funl;
	struct brcms_fifo_info fifo_tb[NUM_FFPLD_FIFO];
@@ -231,18 +229,6 @@ struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc)

void brcms_c_ampdu_detach(struct ampdu_info *ampdu)
{
	int i;

	if (!ampdu)
		return;

	/*
	 * free all ini's which were to be freed on
	 * callbacks which were never called
	 */
	for (i = 0; i < AMPDU_INI_FREE; i++)
		kfree(ampdu->ini_free[i]);

	kfree(ampdu);
}

+0 −1
Original line number Diff line number Diff line
@@ -229,7 +229,6 @@ struct dma_seg {
};

struct dma_seg_map {
	void *oshdmah;	/* Opaque handle for OSL to store its information */
	uint origsize;	/* Size of the virtual packet */
	uint nsegs;
	struct dma_seg segs[MAX_DMA_SEGS];
+2 −2
Original line number Diff line number Diff line
@@ -802,7 +802,7 @@ static struct brcms_info *brcms_attach(u16 vendor, u16 device,
	}

	/* common load-time initialization */
	wl->wlc = brcms_c_attach((void *)wl, vendor, device, unit, false,
	wl->wlc = brcms_c_attach(wl, vendor, device, unit, false,
				 wl->regsva, btparam, &err);
	brcms_release_fw(wl);
	if (!wl->wlc) {
@@ -1782,7 +1782,7 @@ static int brcms_request_fw(struct brcms_info *wl, struct pci_dev *pdev)
	char fw_name[100];
	int i;

	memset((void *)&wl->fw, 0, sizeof(struct brcms_firmware));
	memset(&wl->fw, 0, sizeof(struct brcms_firmware));
	for (i = 0; i < MAX_FW_IMAGES; i++) {
		if (brcms_firmwares[i] == NULL)
			break;
+2 −2
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ struct brcms_firmware {

struct brcms_info {
	struct brcms_pub *pub;		/* pointer to public wlc state */
	void *wlc;		/* pointer to private common data */
	struct brcms_c_info *wlc;	/* pointer to private common data */
	u32 magic;

	int irq;
+22 −23
Original line number Diff line number Diff line
@@ -367,9 +367,9 @@ static u32 brcms_c_wlintrsoff(struct brcms_c_info *wlc);
static void brcms_c_wlintrsrestore(struct brcms_c_info *wlc, u32 macintmask);
static void brcms_c_gpio_init(struct brcms_c_info *wlc);
static void brcms_c_write_hw_bcntemplate0(struct brcms_hardware *wlc_hw,
					  void *bcn, int len);
					  u16 bcn[], int len);
static void brcms_c_write_hw_bcntemplate1(struct brcms_hardware *wlc_hw,
					  void *bcn, int len);
					  u16 bcn[], int len);
static void brcms_b_bsinit(struct brcms_c_info *wlc, u16 chanspec);
static u32 brcms_c_setband_inact(struct brcms_c_info *wlc, uint bandunit);
static void brcms_b_setband(struct brcms_hardware *wlc_hw, uint bandunit,
@@ -457,6 +457,8 @@ static uint brcms_c_down_del_timer(struct brcms_c_info *wlc);
static void brcms_c_ofdm_rateset_war(struct brcms_c_info *wlc);
static int _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
		      struct brcms_c_if *wlcif);
static void brcms_c_write_hw_bcntemplates(struct brcms_c_info *wlc, u16 bcn[],
					  int len, bool both);

const u8 prio2fifo[NUMPRIO] = {
	TX_AC_BE_FIFO,		/* 0    BE      AC_BE   Best Effort */
@@ -1375,7 +1377,7 @@ void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw)
}

static void
brcms_c_write_hw_bcntemplate0(struct brcms_hardware *wlc_hw, void *bcn,
brcms_c_write_hw_bcntemplate0(struct brcms_hardware *wlc_hw, u16 bcn[],
			      int len)
{
	struct d11regs *regs = wlc_hw->regs;
@@ -1389,7 +1391,7 @@ brcms_c_write_hw_bcntemplate0(struct brcms_hardware *wlc_hw, void *bcn,
}

static void
brcms_c_write_hw_bcntemplate1(struct brcms_hardware *wlc_hw, void *bcn,
brcms_c_write_hw_bcntemplate1(struct brcms_hardware *wlc_hw, u16 bcn[],
			      int len)
{
	struct d11regs *regs = wlc_hw->regs;
@@ -4287,9 +4289,9 @@ static uint brcms_c_attach_module(struct brcms_c_info *wlc)
	return err;
}

struct brcms_pub *brcms_c_pub(void *wlc)
struct brcms_pub *brcms_c_pub(struct brcms_c_info *wlc)
{
	return ((struct brcms_c_info *) wlc)->pub;
	return wlc->pub;
}

#define CHIP_SUPPORTS_11N(wlc)	1
@@ -4644,7 +4646,7 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
/*
 * The common driver entry routine. Error codes should be unique
 */
void *
struct brcms_c_info *
brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
	       bool piomode, void *regsva, struct pci_dev *btparam, uint *perr)
{
@@ -4884,7 +4886,7 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
	if (perr)
		*perr = 0;

	return (void *)wlc;
	return wlc;

 fail:
	wiphy_err(wl->wiphy, "wl%d: %s: failed with err %d\n",
@@ -6319,7 +6321,7 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
 * register watchdog and down handlers.
 */
int brcms_c_module_register(struct brcms_pub *pub,
			    const char *name, void *hdl,
			    const char *name, struct brcms_info *hdl,
			    int (*d_fn)(void *handle))
{
	struct brcms_c_info *wlc = (struct brcms_c_info *) pub->wlc;
@@ -6340,8 +6342,8 @@ int brcms_c_module_register(struct brcms_pub *pub,
}

/* unregister module callbacks */
int
brcms_c_module_unregister(struct brcms_pub *pub, const char *name, void *hdl)
int brcms_c_module_unregister(struct brcms_pub *pub, const char *name,
			      struct brcms_info *hdl)
{
	struct brcms_c_info *wlc = (struct brcms_c_info *) pub->wlc;
	int i;
@@ -6668,8 +6670,8 @@ static u16 brcms_c_rate_shm_offset(struct brcms_c_info *wlc, u8 rate)
 *
 * Returns true if packet consumed (queued), false if not.
 */
bool
brcms_c_prec_enq(struct brcms_c_info *wlc, struct pktq *q, void *pkt, int prec)
bool brcms_c_prec_enq(struct brcms_c_info *wlc, struct pktq *q,
		      struct sk_buff *pkt, int prec)
{
	return brcms_c_prec_enq_head(wlc, q, pkt, prec, false);
}
@@ -6721,10 +6723,9 @@ brcms_c_prec_enq_head(struct brcms_c_info *wlc, struct pktq *q,
	return true;
}

void brcms_c_txq_enq(void *ctx, struct scb *scb, struct sk_buff *sdu,
			     uint prec)
void brcms_c_txq_enq(struct brcms_c_info *wlc, struct scb *scb,
		     struct sk_buff *sdu, uint prec)
{
	struct brcms_c_info *wlc = (struct brcms_c_info *) ctx;
	struct brcms_txq_info *qi = wlc->pkt_queue;	/* Check me */
	struct pktq *q = &qi->q;
	int prio;
@@ -6767,7 +6768,6 @@ brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, struct sk_buff *sdu,
{
	u8 prio;
	uint fifo;
	void *pkt;
	struct scb *scb = &global_scb;
	struct ieee80211_hdr *d11_header = (struct ieee80211_hdr *)(sdu->data);

@@ -6778,12 +6778,11 @@ brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, struct sk_buff *sdu,
	prio = ieee80211_is_data(d11_header->frame_control) ? sdu->priority :
		MAXPRIO;
	fifo = prio2fifo[prio];
	pkt = sdu;
	if (unlikely
	    (brcms_c_d11hdrs_mac80211(
		wlc, hw, pkt, scb, 0, 1, fifo, 0, NULL, 0)))
		wlc, hw, sdu, scb, 0, 1, fifo, 0, NULL, 0)))
		return -EINVAL;
	brcms_c_txq_enq(wlc, scb, pkt, BRCMS_PRIO_TO_PREC(prio));
	brcms_c_txq_enq(wlc, scb, sdu, BRCMS_PRIO_TO_PREC(prio));
	brcms_c_send_q(wlc);
	return 0;
}
@@ -8969,7 +8968,7 @@ int brcms_c_get_header_len()

/* mac is assumed to be suspended at this point */
void
brcms_b_write_hw_bcntemplates(struct brcms_hardware *wlc_hw, void *bcn,
brcms_b_write_hw_bcntemplates(struct brcms_hardware *wlc_hw, u16 bcn[],
			      int len, bool both)
{
	struct d11regs *regs = wlc_hw->regs;
@@ -9424,7 +9423,7 @@ void brcms_c_write_template_ram(struct brcms_c_info *wlc, int offset, int len,
	brcms_b_write_template_ram(wlc->hw, offset, len, buf);
}

void brcms_c_write_hw_bcntemplates(struct brcms_c_info *wlc, void *bcn, int len,
void brcms_c_write_hw_bcntemplates(struct brcms_c_info *wlc, u16 bcn[], int len,
				   bool both)
{
	brcms_b_write_hw_bcntemplates(wlc->hw, bcn, len, both);
Loading