aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFranky Lin <frankyl@broadcom.com>2012-06-26 15:26:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-27 15:23:17 -0400
commit135e4c6184d29f0834078bf150009a77b9dae717 (patch)
tree8b73b841d5c00ae819acb83f9e3dc7d8d266461d /drivers
parentd2bb2b9e9161d221badafae063d0c62b41bf3078 (diff)
brcmfmac: add support for bus specific data command
brcmfmac need to support data command setting for dongle's bus core. A list must be placed at brcmf_bus structure before calling brcmf_bus_start in order to be sent by brcmf_c_preinit_dcmds. Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h8
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c16
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c2
3 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
index 366916494be4..537f499cc5d2 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
@@ -36,6 +36,13 @@ struct dngl_stats {
36 unsigned long multicast; /* multicast packets received */ 36 unsigned long multicast; /* multicast packets received */
37}; 37};
38 38
39struct brcmf_bus_dcmd {
40 char *name;
41 char *param;
42 int param_len;
43 struct list_head list;
44};
45
39/* interface structure between common and bus layer */ 46/* interface structure between common and bus layer */
40struct brcmf_bus { 47struct brcmf_bus {
41 u8 type; /* bus type */ 48 u8 type; /* bus type */
@@ -50,6 +57,7 @@ struct brcmf_bus {
50 unsigned long tx_realloc; /* Tx packets realloced for headroom */ 57 unsigned long tx_realloc; /* Tx packets realloced for headroom */
51 struct dngl_stats dstats; /* Stats for dongle-based data */ 58 struct dngl_stats dstats; /* Stats for dongle-based data */
52 u8 align; /* bus alignment requirement */ 59 u8 align; /* bus alignment requirement */
60 struct list_head dcmd_list;
53 61
54 /* interface functions pointers */ 62 /* interface functions pointers */
55 /* Stop bus module: clear pending frames, disable data flow */ 63 /* Stop bus module: clear pending frames, disable data flow */
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
index 236cb9fa460c..1c9eb1893d29 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
@@ -807,6 +807,8 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr)
807 int scan_assoc_time = 40; 807 int scan_assoc_time = 40;
808 int scan_unassoc_time = 40; 808 int scan_unassoc_time = 40;
809 int i; 809 int i;
810 struct brcmf_bus_dcmd *cmdlst;
811 struct list_head *cur, *q;
810 812
811 mutex_lock(&drvr->proto_block); 813 mutex_lock(&drvr->proto_block);
812 814
@@ -874,6 +876,20 @@ int brcmf_c_preinit_dcmds(struct brcmf_pub *drvr)
874 0, true); 876 0, true);
875 } 877 }
876 878
879 /* set bus specific command if there is any */
880 list_for_each_safe(cur, q, &drvr->bus_if->dcmd_list) {
881 cmdlst = list_entry(cur, struct brcmf_bus_dcmd, list);
882 if (cmdlst->name && cmdlst->param && cmdlst->param_len) {
883 brcmf_c_mkiovar(cmdlst->name, cmdlst->param,
884 cmdlst->param_len, iovbuf,
885 sizeof(iovbuf));
886 brcmf_proto_cdc_set_dcmd(drvr, 0, BRCMF_C_SET_VAR,
887 iovbuf, sizeof(iovbuf));
888 }
889 list_del(cur);
890 kfree(cmdlst);
891 }
892
877 mutex_unlock(&drvr->proto_block); 893 mutex_unlock(&drvr->proto_block);
878 894
879 return 0; 895 return 0;
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index 01cf6c03390b..57bf1d7ee80f 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -1020,6 +1020,8 @@ int brcmf_attach(uint bus_hdrlen, struct device *dev)
1020 INIT_WORK(&drvr->setmacaddr_work, _brcmf_set_mac_address); 1020 INIT_WORK(&drvr->setmacaddr_work, _brcmf_set_mac_address);
1021 INIT_WORK(&drvr->multicast_work, _brcmf_set_multicast_list); 1021 INIT_WORK(&drvr->multicast_work, _brcmf_set_multicast_list);
1022 1022
1023 INIT_LIST_HEAD(&drvr->bus_if->dcmd_list);
1024
1023 return ret; 1025 return ret;
1024 1026
1025fail: 1027fail: