diff options
author | Franky Lin <frankyl@broadcom.com> | 2011-12-16 21:36:54 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-19 14:40:43 -0500 |
commit | 55a63bcc4cdeabf76f7e42a76d0c59dbe37d0d64 (patch) | |
tree | 4dcba766bf74b1fdbd4cc4ab68288187d1bc90dd | |
parent | fbf59108f9e13e19cef7a0291a522906c0b0f8e4 (diff) |
brcm80211: fmac: change function add_if parameter
Change parameter to device pointer for bus layer interface function
brcmf_add_if. This is part of the fullmac bus interface
refactoring.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h index 74ea4b034001..a8e94eb8a7e7 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h | |||
@@ -574,6 +574,7 @@ struct brcmf_dcmd { | |||
574 | struct brcmf_bus { | 574 | struct brcmf_bus { |
575 | u8 type; /* bus type */ | 575 | u8 type; /* bus type */ |
576 | void *bus_priv; /* pointer to bus private structure */ | 576 | void *bus_priv; /* pointer to bus private structure */ |
577 | void *drvr; /* pointer to driver pub structure brcmf_pub */ | ||
577 | enum brcmf_bus_state state; | 578 | enum brcmf_bus_state state; |
578 | }; | 579 | }; |
579 | 580 | ||
@@ -743,7 +744,7 @@ extern int brcmf_c_host_event(struct brcmf_pub *drvr, int *idx, | |||
743 | void *pktdata, struct brcmf_event_msg *, | 744 | void *pktdata, struct brcmf_event_msg *, |
744 | void **data_ptr); | 745 | void **data_ptr); |
745 | 746 | ||
746 | extern int brcmf_add_if(struct brcmf_pub *drvr, int ifidx, | 747 | extern int brcmf_add_if(struct device *dev, int ifidx, |
747 | char *name, u8 *mac_addr); | 748 | char *name, u8 *mac_addr); |
748 | extern void brcmf_del_if(struct brcmf_pub *drvr, int ifidx); | 749 | extern void brcmf_del_if(struct brcmf_pub *drvr, int ifidx); |
749 | 750 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c index 5e5a95446f51..e9f7d66b7ec6 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c | |||
@@ -473,7 +473,7 @@ brcmf_c_host_event(struct brcmf_pub *drvr, int *ifidx, void *pktdata, | |||
473 | 473 | ||
474 | if (ifevent->ifidx > 0 && ifevent->ifidx < BRCMF_MAX_IFS) { | 474 | if (ifevent->ifidx > 0 && ifevent->ifidx < BRCMF_MAX_IFS) { |
475 | if (ifevent->action == BRCMF_E_IF_ADD) | 475 | if (ifevent->action == BRCMF_E_IF_ADD) |
476 | brcmf_add_if(drvr, ifevent->ifidx, | 476 | brcmf_add_if(drvr->dev, ifevent->ifidx, |
477 | event->ifname, | 477 | event->ifname, |
478 | pvt_data->eth.h_dest); | 478 | pvt_data->eth.h_dest); |
479 | else | 479 | else |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index cd0a698aaa7f..3d0177ab2501 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -840,10 +840,12 @@ static const struct net_device_ops brcmf_netdev_ops_pri = { | |||
840 | }; | 840 | }; |
841 | 841 | ||
842 | int | 842 | int |
843 | brcmf_add_if(struct brcmf_pub *drvr, int ifidx, char *name, u8 *mac_addr) | 843 | brcmf_add_if(struct device *dev, int ifidx, char *name, u8 *mac_addr) |
844 | { | 844 | { |
845 | struct brcmf_if *ifp; | 845 | struct brcmf_if *ifp; |
846 | struct net_device *ndev; | 846 | struct net_device *ndev; |
847 | struct brcmf_bus *bus_if = dev_get_drvdata(dev); | ||
848 | struct brcmf_pub *drvr = bus_if->drvr; | ||
847 | 849 | ||
848 | brcmf_dbg(TRACE, "idx %d\n", ifidx); | 850 | brcmf_dbg(TRACE, "idx %d\n", ifidx); |
849 | 851 | ||
@@ -937,6 +939,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen, | |||
937 | drvr->bus = bus; | 939 | drvr->bus = bus; |
938 | drvr->hdrlen = bus_hdrlen; | 940 | drvr->hdrlen = bus_hdrlen; |
939 | drvr->bus_if = dev_get_drvdata(dev); | 941 | drvr->bus_if = dev_get_drvdata(dev); |
942 | drvr->bus_if->drvr = drvr; | ||
940 | drvr->dev = dev; | 943 | drvr->dev = dev; |
941 | 944 | ||
942 | /* Attach and link in the protocol */ | 945 | /* Attach and link in the protocol */ |
@@ -1108,6 +1111,7 @@ void brcmf_detach(struct brcmf_pub *drvr) | |||
1108 | if (drvr->prot) | 1111 | if (drvr->prot) |
1109 | brcmf_proto_detach(drvr); | 1112 | brcmf_proto_detach(drvr); |
1110 | 1113 | ||
1114 | drvr->bus_if->drvr = NULL; | ||
1111 | kfree(drvr); | 1115 | kfree(drvr); |
1112 | } | 1116 | } |
1113 | } | 1117 | } |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index 3096166afbe1..4e3e4ec8158b 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -3980,7 +3980,7 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev) | |||
3980 | } | 3980 | } |
3981 | 3981 | ||
3982 | /* add interface and open for business */ | 3982 | /* add interface and open for business */ |
3983 | if (brcmf_add_if(bus->drvr, 0, "wlan%d", NULL)) { | 3983 | if (brcmf_add_if(bus->sdiodev->dev, 0, "wlan%d", NULL)) { |
3984 | brcmf_dbg(ERROR, "Add primary net device interface failed!!\n"); | 3984 | brcmf_dbg(ERROR, "Add primary net device interface failed!!\n"); |
3985 | goto fail; | 3985 | goto fail; |
3986 | } | 3986 | } |