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

Commit 81f5dcb8 authored by Hante Meuleman's avatar Hante Meuleman Committed by John W. Linville
Browse files

brcmfmac: refactor firmware interface layer.



Refactor the functions that are related to getting and setting
data to and and from the firmware.

Reviewed-by: default avatarArend Van Spriel <arend@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6c4a5f24
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ ccflags-y += -D__CHECK_ENDIAN__
obj-$(CONFIG_BRCMFMAC) += brcmfmac.o
brcmfmac-objs += \
		wl_cfg80211.o \
		fwil.o \
		dhd_cdc.o \
		dhd_common.o \
		dhd_linux.o
+25 −4
Original line number Diff line number Diff line
@@ -318,6 +318,12 @@ struct brcmf_event {
#define BRCMF_E_LINK_ASSOC_REC			3
#define BRCMF_E_LINK_BSSCFG_DIS			4

/* Small, medium and maximum buffer size for dcmd
 */
#define BRCMF_DCMD_SMLEN	256
#define BRCMF_DCMD_MEDLEN	1536
#define BRCMF_DCMD_MAXLEN	8192

/* Pattern matching filter. Specifies an offset within received packets to
 * start matching, the pattern to match, the size of the pattern, and a bitmask
 * that indicates which bits within the pattern should be matched.
@@ -661,6 +667,7 @@ struct brcmf_pub {
	struct brcmf_if *iflist[BRCMF_MAX_IFS];

	struct mutex proto_block;
	unsigned char proto_buf[BRCMF_DCMD_MAXLEN];

	struct work_struct setmacaddr_work;
	struct work_struct multicast_work;
@@ -671,6 +678,22 @@ struct brcmf_pub {
#endif
};

/* struct brcmf_if - Interface control information
 *
 * @drvr: back pointer to brcmf_pub
 * @ndev: interface net device pointer
 * @stats: net device statistics
 * @idx: iface idx in dongle
 * @mac_addr: assigned MAC address
 */
struct brcmf_if {
	struct brcmf_pub *drvr;
	struct net_device *ndev;
	struct net_device_stats stats;
	int idx;
	u8 mac_addr[ETH_ALEN];
};

struct brcmf_if_event {
	u8 ifidx;
	u8 action;
@@ -701,6 +724,8 @@ extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
/* Query dongle */
extern int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx,
				       uint cmd, void *buf, uint len);
extern int brcmf_proto_cdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
				    void *buf, uint len);

extern int brcmf_ifname2idx(struct brcmf_pub *drvr, char *name);
extern int brcmf_c_host_event(struct brcmf_pub *drvr, int *idx,
@@ -713,8 +738,4 @@ extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg);
extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg,
					     int enable, int master_mode);

#define	BRCMF_DCMD_SMLEN	256	/* "small" cmd buffer required */
#define BRCMF_DCMD_MEDLEN	1536	/* "med" cmd buffer required */
#define	BRCMF_DCMD_MAXLEN	8192	/* max length cmd buffer required */

#endif				/* _BRCMF_H_ */
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/if.h>
#include <linux/ieee80211.h>
#include <linux/module.h>
#include <linux/netdevice.h>

#include <defs.h>
#include <brcmu_wifi.h>
+3 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#define BRCMF_EVENT_VAL	0x0800
#define BRCMF_BTA_VAL	0x1000
#define BRCMF_ISCAN_VAL 0x2000
#define BRCMF_FIL_VAL	0x4000

#if defined(DEBUG)

@@ -56,6 +57,7 @@ do { \
#define BRCMF_BYTES_ON()	(brcmf_msg_level & BRCMF_BYTES_VAL)
#define BRCMF_GLOM_ON()		(brcmf_msg_level & BRCMF_GLOM_VAL)
#define BRCMF_EVENT_ON()	(brcmf_msg_level & BRCMF_EVENT_VAL)
#define BRCMF_FIL_ON()		(brcmf_msg_level & BRCMF_FIL_VAL)

#else	/* (defined DEBUG) || (defined DEBUG) */

@@ -67,6 +69,7 @@ do { \
#define BRCMF_BYTES_ON()	0
#define BRCMF_GLOM_ON()		0
#define BRCMF_EVENT_ON()	0
#define BRCMF_FIL_ON()		0

#endif				/* defined(DEBUG) */

+0 −10
Original line number Diff line number Diff line
@@ -52,16 +52,6 @@ MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN fullmac cards");
MODULE_LICENSE("Dual BSD/GPL");


/* Interface control information */
struct brcmf_if {
	struct brcmf_pub *drvr;	/* back pointer to brcmf_pub */
	/* OS/stack specifics */
	struct net_device *ndev;
	struct net_device_stats stats;
	int idx;		/* iface idx in dongle */
	u8 mac_addr[ETH_ALEN];	/* assigned MAC address */
};

/* Error bits */
int brcmf_msg_level = BRCMF_ERROR_VAL;
module_param(brcmf_msg_level, int, 0);
Loading