Commit 37a869ec authored by Hante Meuleman's avatar Hante Meuleman Committed by Kalle Valo

brcmfmac: Use consistent naming for bsscfgidx.

The variable bsscfgidx is used in different places with different
names, e.g. bsscfg, bssidx, bsscfg_idx. This patch cleans this up
by using bsscfgidx everywhere.
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 avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 8abffd81
...@@ -776,7 +776,8 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, ...@@ -776,7 +776,8 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
s32 ap = 0; s32 ap = 0;
s32 err = 0; s32 err = 0;
brcmf_dbg(TRACE, "Enter, idx=%d, type=%d\n", ifp->bssidx, type); brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, type=%d\n", ifp->bsscfgidx,
type);
/* WAR: There are a number of p2p interface related problems which /* WAR: There are a number of p2p interface related problems which
* need to be handled initially (before doing the validate). * need to be handled initially (before doing the validate).
...@@ -2921,7 +2922,7 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp, ...@@ -2921,7 +2922,7 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp,
status = e->status; status = e->status;
if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) { if (!test_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status)) {
brcmf_err("scan not ready, bssidx=%d\n", ifp->bssidx); brcmf_err("scan not ready, bsscfgidx=%d\n", ifp->bsscfgidx);
return -EPERM; return -EPERM;
} }
...@@ -3877,7 +3878,8 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag, ...@@ -3877,7 +3878,8 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag,
ifp = vif->ifp; ifp = vif->ifp;
saved_ie = &vif->saved_ie; saved_ie = &vif->saved_ie;
brcmf_dbg(TRACE, "bssidx %d, pktflag : 0x%02X\n", ifp->bssidx, pktflag); brcmf_dbg(TRACE, "bsscfgidx %d, pktflag : 0x%02X\n", ifp->bsscfgidx,
pktflag);
iovar_ie_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); iovar_ie_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
if (!iovar_ie_buf) if (!iovar_ie_buf)
return -ENOMEM; return -ENOMEM;
...@@ -4241,7 +4243,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, ...@@ -4241,7 +4243,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
brcmf_err("setting ssid failed %d\n", err); brcmf_err("setting ssid failed %d\n", err);
goto exit; goto exit;
} }
bss_enable.bsscfg_idx = cpu_to_le32(ifp->bssidx); bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
bss_enable.enable = cpu_to_le32(1); bss_enable.enable = cpu_to_le32(1);
err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
sizeof(bss_enable)); sizeof(bss_enable));
...@@ -4308,7 +4310,7 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ...@@ -4308,7 +4310,7 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
if (err < 0) if (err < 0)
brcmf_err("BRCMF_C_UP error %d\n", err); brcmf_err("BRCMF_C_UP error %d\n", err);
} else { } else {
bss_enable.bsscfg_idx = cpu_to_le32(ifp->bssidx); bss_enable.bsscfgidx = cpu_to_le32(ifp->bsscfgidx);
bss_enable.enable = cpu_to_le32(0); bss_enable.enable = cpu_to_le32(0);
err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable,
sizeof(bss_enable)); sizeof(bss_enable));
...@@ -5094,9 +5096,9 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp, ...@@ -5094,9 +5096,9 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,
struct brcmf_cfg80211_vif_event *event = &cfg->vif_event; struct brcmf_cfg80211_vif_event *event = &cfg->vif_event;
struct brcmf_cfg80211_vif *vif; struct brcmf_cfg80211_vif *vif;
brcmf_dbg(TRACE, "Enter: action %u flags %u ifidx %u bsscfg %u\n", brcmf_dbg(TRACE, "Enter: action %u flags %u ifidx %u bsscfgidx %u\n",
ifevent->action, ifevent->flags, ifevent->ifidx, ifevent->action, ifevent->flags, ifevent->ifidx,
ifevent->bssidx); ifevent->bsscfgidx);
mutex_lock(&event->vif_event_lock); mutex_lock(&event->vif_event_lock);
event->action = ifevent->action; event->action = ifevent->action;
......
...@@ -80,7 +80,7 @@ char *brcmf_ifname(struct brcmf_if *ifp) ...@@ -80,7 +80,7 @@ char *brcmf_ifname(struct brcmf_if *ifp)
struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx) struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx)
{ {
struct brcmf_if *ifp; struct brcmf_if *ifp;
s32 bssidx; s32 bsscfgidx;
if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) { if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) {
brcmf_err("ifidx %d out of range\n", ifidx); brcmf_err("ifidx %d out of range\n", ifidx);
...@@ -88,9 +88,9 @@ struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx) ...@@ -88,9 +88,9 @@ struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx)
} }
ifp = NULL; ifp = NULL;
bssidx = drvr->if2bss[ifidx]; bsscfgidx = drvr->if2bss[ifidx];
if (bssidx >= 0) if (bsscfgidx >= 0)
ifp = drvr->iflist[bssidx]; ifp = drvr->iflist[bsscfgidx];
return ifp; return ifp;
} }
...@@ -108,7 +108,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work) ...@@ -108,7 +108,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
ifp = container_of(work, struct brcmf_if, multicast_work); ifp = container_of(work, struct brcmf_if, multicast_work);
brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx); brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
ndev = ifp->ndev; ndev = ifp->ndev;
...@@ -168,7 +168,7 @@ _brcmf_set_mac_address(struct work_struct *work) ...@@ -168,7 +168,7 @@ _brcmf_set_mac_address(struct work_struct *work)
ifp = container_of(work, struct brcmf_if, setmacaddr_work); ifp = container_of(work, struct brcmf_if, setmacaddr_work);
brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx); brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", ifp->mac_addr, err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", ifp->mac_addr,
ETH_ALEN); ETH_ALEN);
...@@ -206,7 +206,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, ...@@ -206,7 +206,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
struct brcmf_pub *drvr = ifp->drvr; struct brcmf_pub *drvr = ifp->drvr;
struct ethhdr *eh = (struct ethhdr *)(skb->data); struct ethhdr *eh = (struct ethhdr *)(skb->data);
brcmf_dbg(DATA, "Enter, idx=%d\n", ifp->bssidx); brcmf_dbg(DATA, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
/* Can the device send data? */ /* Can the device send data? */
if (drvr->bus_if->state != BRCMF_BUS_UP) { if (drvr->bus_if->state != BRCMF_BUS_UP) {
...@@ -267,8 +267,8 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp, ...@@ -267,8 +267,8 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp,
if (!ifp || !ifp->ndev) if (!ifp || !ifp->ndev)
return; return;
brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n", brcmf_dbg(TRACE, "enter: bsscfgidx=%d stop=0x%X reason=%d state=%d\n",
ifp->bssidx, ifp->netif_stop, reason, state); ifp->bsscfgidx, ifp->netif_stop, reason, state);
spin_lock_irqsave(&ifp->netif_stop_lock, flags); spin_lock_irqsave(&ifp->netif_stop_lock, flags);
if (state) { if (state) {
...@@ -587,7 +587,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *ndev) ...@@ -587,7 +587,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *ndev)
{ {
struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_if *ifp = netdev_priv(ndev);
brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx); brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
return &ifp->stats; return &ifp->stats;
} }
...@@ -616,7 +616,7 @@ static int brcmf_netdev_stop(struct net_device *ndev) ...@@ -616,7 +616,7 @@ static int brcmf_netdev_stop(struct net_device *ndev)
{ {
struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_if *ifp = netdev_priv(ndev);
brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx); brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
brcmf_cfg80211_down(ndev); brcmf_cfg80211_down(ndev);
...@@ -632,7 +632,7 @@ static int brcmf_netdev_open(struct net_device *ndev) ...@@ -632,7 +632,7 @@ static int brcmf_netdev_open(struct net_device *ndev)
struct brcmf_bus *bus_if = drvr->bus_if; struct brcmf_bus *bus_if = drvr->bus_if;
u32 toe_ol; u32 toe_ol;
brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx); brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx);
/* If bus is not ready, can't continue */ /* If bus is not ready, can't continue */
if (bus_if->state != BRCMF_BUS_UP) { if (bus_if->state != BRCMF_BUS_UP) {
...@@ -674,7 +674,7 @@ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked) ...@@ -674,7 +674,7 @@ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked)
struct net_device *ndev; struct net_device *ndev;
s32 err; s32 err;
brcmf_dbg(TRACE, "Enter, idx=%d mac=%pM\n", ifp->bssidx, brcmf_dbg(TRACE, "Enter, bsscfgidx=%d mac=%pM\n", ifp->bsscfgidx,
ifp->mac_addr); ifp->mac_addr);
ndev = ifp->ndev; ndev = ifp->ndev;
...@@ -706,7 +706,7 @@ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked) ...@@ -706,7 +706,7 @@ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked)
return 0; return 0;
fail: fail:
drvr->iflist[ifp->bssidx] = NULL; drvr->iflist[ifp->bsscfgidx] = NULL;
ndev->netdev_ops = NULL; ndev->netdev_ops = NULL;
free_netdev(ndev); free_netdev(ndev);
return -EBADE; return -EBADE;
...@@ -724,7 +724,8 @@ void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on) ...@@ -724,7 +724,8 @@ void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on)
{ {
struct net_device *ndev; struct net_device *ndev;
brcmf_dbg(TRACE, "Enter, idx=%d carrier=%d\n", ifp->bssidx, on); brcmf_dbg(TRACE, "Enter, bsscfgidx=%d carrier=%d\n", ifp->bsscfgidx,
on);
ndev = ifp->ndev; ndev = ifp->ndev;
brcmf_txflowblock_if(ifp, BRCMF_NETIF_STOP_REASON_DISCONNECTED, !on); brcmf_txflowblock_if(ifp, BRCMF_NETIF_STOP_REASON_DISCONNECTED, !on);
...@@ -771,7 +772,7 @@ static int brcmf_net_p2p_attach(struct brcmf_if *ifp) ...@@ -771,7 +772,7 @@ static int brcmf_net_p2p_attach(struct brcmf_if *ifp)
{ {
struct net_device *ndev; struct net_device *ndev;
brcmf_dbg(TRACE, "Enter, idx=%d mac=%pM\n", ifp->bssidx, brcmf_dbg(TRACE, "Enter, bsscfgidx=%d mac=%pM\n", ifp->bsscfgidx,
ifp->mac_addr); ifp->mac_addr);
ndev = ifp->ndev; ndev = ifp->ndev;
...@@ -790,21 +791,21 @@ static int brcmf_net_p2p_attach(struct brcmf_if *ifp) ...@@ -790,21 +791,21 @@ static int brcmf_net_p2p_attach(struct brcmf_if *ifp)
return 0; return 0;
fail: fail:
ifp->drvr->iflist[ifp->bssidx] = NULL; ifp->drvr->iflist[ifp->bsscfgidx] = NULL;
ndev->netdev_ops = NULL; ndev->netdev_ops = NULL;
free_netdev(ndev); free_netdev(ndev);
return -EBADE; return -EBADE;
} }
struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx,
bool is_p2pdev, char *name, u8 *mac_addr) bool is_p2pdev, char *name, u8 *mac_addr)
{ {
struct brcmf_if *ifp; struct brcmf_if *ifp;
struct net_device *ndev; struct net_device *ndev;
brcmf_dbg(TRACE, "Enter, idx=%d, ifidx=%d\n", bssidx, ifidx); brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", bsscfgidx, ifidx);
ifp = drvr->iflist[bssidx]; ifp = drvr->iflist[bsscfgidx];
/* /*
* Delete the existing interface before overwriting it * Delete the existing interface before overwriting it
* in case we missed the BRCMF_E_IF_DEL event. * in case we missed the BRCMF_E_IF_DEL event.
...@@ -815,7 +816,7 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, ...@@ -815,7 +816,7 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx,
if (ifidx) { if (ifidx) {
netif_stop_queue(ifp->ndev); netif_stop_queue(ifp->ndev);
brcmf_net_detach(ifp->ndev); brcmf_net_detach(ifp->ndev);
drvr->iflist[bssidx] = NULL; drvr->iflist[bsscfgidx] = NULL;
} else { } else {
brcmf_err("ignore IF event\n"); brcmf_err("ignore IF event\n");
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
...@@ -839,15 +840,15 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, ...@@ -839,15 +840,15 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx,
ndev->destructor = brcmf_cfg80211_free_netdev; ndev->destructor = brcmf_cfg80211_free_netdev;
ifp = netdev_priv(ndev); ifp = netdev_priv(ndev);
ifp->ndev = ndev; ifp->ndev = ndev;
/* store mapping ifidx to bssidx */ /* store mapping ifidx to bsscfgidx */
if (drvr->if2bss[ifidx] == BRCMF_BSSIDX_INVALID) if (drvr->if2bss[ifidx] == BRCMF_BSSIDX_INVALID)
drvr->if2bss[ifidx] = bssidx; drvr->if2bss[ifidx] = bsscfgidx;
} }
ifp->drvr = drvr; ifp->drvr = drvr;
drvr->iflist[bssidx] = ifp; drvr->iflist[bsscfgidx] = ifp;
ifp->ifidx = ifidx; ifp->ifidx = ifidx;
ifp->bssidx = bssidx; ifp->bsscfgidx = bsscfgidx;
init_waitqueue_head(&ifp->pend_8021x_wait); init_waitqueue_head(&ifp->pend_8021x_wait);
spin_lock_init(&ifp->netif_stop_lock); spin_lock_init(&ifp->netif_stop_lock);
...@@ -861,21 +862,22 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, ...@@ -861,21 +862,22 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx,
return ifp; return ifp;
} }
static void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx) static void brcmf_del_if(struct brcmf_pub *drvr, s32 bsscfgidx)
{ {
struct brcmf_if *ifp; struct brcmf_if *ifp;
ifp = drvr->iflist[bssidx]; ifp = drvr->iflist[bsscfgidx];
drvr->iflist[bssidx] = NULL; drvr->iflist[bsscfgidx] = NULL;
if (!ifp) { if (!ifp) {
brcmf_err("Null interface, idx=%d\n", bssidx); brcmf_err("Null interface, bsscfgidx=%d\n", bsscfgidx);
return; return;
} }
brcmf_dbg(TRACE, "Enter, idx=%d, ifidx=%d\n", bssidx, ifp->ifidx); brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", bsscfgidx,
if (drvr->if2bss[ifp->ifidx] == bssidx) ifp->ifidx);
if (drvr->if2bss[ifp->ifidx] == bsscfgidx)
drvr->if2bss[ifp->ifidx] = BRCMF_BSSIDX_INVALID; drvr->if2bss[ifp->ifidx] = BRCMF_BSSIDX_INVALID;
if (ifp->ndev) { if (ifp->ndev) {
if (bssidx == 0) { if (bsscfgidx == 0) {
if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) { if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) {
rtnl_lock(); rtnl_lock();
brcmf_netdev_stop(ifp->ndev); brcmf_netdev_stop(ifp->ndev);
...@@ -905,12 +907,12 @@ static void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx) ...@@ -905,12 +907,12 @@ static void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx)
void brcmf_remove_interface(struct brcmf_if *ifp) void brcmf_remove_interface(struct brcmf_if *ifp)
{ {
if (!ifp || WARN_ON(ifp->drvr->iflist[ifp->bssidx] != ifp)) if (!ifp || WARN_ON(ifp->drvr->iflist[ifp->bsscfgidx] != ifp))
return; return;
brcmf_dbg(TRACE, "Enter, bssidx=%d, ifidx=%d\n", ifp->bssidx, brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", ifp->bsscfgidx,
ifp->ifidx); ifp->ifidx);
brcmf_fws_del_interface(ifp); brcmf_fws_del_interface(ifp);
brcmf_del_if(ifp->drvr, ifp->bssidx); brcmf_del_if(ifp->drvr, ifp->bsscfgidx);
} }
int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr) int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr)
...@@ -925,10 +927,10 @@ int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr) ...@@ -925,10 +927,10 @@ int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr)
highest = 2; highest = 2;
for (ifidx = 0; ifidx < BRCMF_MAX_IFS; ifidx++) { for (ifidx = 0; ifidx < BRCMF_MAX_IFS; ifidx++) {
if (drvr->iflist[ifidx]) { if (drvr->iflist[ifidx]) {
if (drvr->iflist[ifidx]->bssidx == bsscfgidx) if (drvr->iflist[ifidx]->bsscfgidx == bsscfgidx)
bsscfgidx = highest + 1; bsscfgidx = highest + 1;
else if (drvr->iflist[ifidx]->bssidx > highest) else if (drvr->iflist[ifidx]->bsscfgidx > highest)
highest = drvr->iflist[ifidx]->bssidx; highest = drvr->iflist[ifidx]->bsscfgidx;
} else { } else {
available = true; available = true;
} }
......
...@@ -174,7 +174,7 @@ enum brcmf_netif_stop_reason { ...@@ -174,7 +174,7 @@ enum brcmf_netif_stop_reason {
* @multicast_work: worker object for multicast provisioning. * @multicast_work: worker object for multicast provisioning.
* @fws_desc: interface specific firmware-signalling descriptor. * @fws_desc: interface specific firmware-signalling descriptor.
* @ifidx: interface index in device firmware. * @ifidx: interface index in device firmware.
* @bssidx: index of bss associated with this interface. * @bsscfgidx: index of bss associated with this interface.
* @mac_addr: assigned mac address. * @mac_addr: assigned mac address.
* @netif_stop: bitmap indicates reason why netif queues are stopped. * @netif_stop: bitmap indicates reason why netif queues are stopped.
* @netif_stop_lock: spinlock for update netif_stop from multiple sources. * @netif_stop_lock: spinlock for update netif_stop from multiple sources.
...@@ -190,7 +190,7 @@ struct brcmf_if { ...@@ -190,7 +190,7 @@ struct brcmf_if {
struct work_struct multicast_work; struct work_struct multicast_work;
struct brcmf_fws_mac_descriptor *fws_desc; struct brcmf_fws_mac_descriptor *fws_desc;
int ifidx; int ifidx;
s32 bssidx; s32 bsscfgidx;
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
u8 netif_stop; u8 netif_stop;
spinlock_t netif_stop_lock; spinlock_t netif_stop_lock;
...@@ -208,7 +208,7 @@ int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp); ...@@ -208,7 +208,7 @@ int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp);
char *brcmf_ifname(struct brcmf_if *ifp); char *brcmf_ifname(struct brcmf_if *ifp);
struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx); struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx);
int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked); int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx, struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx,
bool is_p2pdev, char *name, u8 *mac_addr); bool is_p2pdev, char *name, u8 *mac_addr);
void brcmf_remove_interface(struct brcmf_if *ifp); void brcmf_remove_interface(struct brcmf_if *ifp);
int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr); int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr);
......
...@@ -49,7 +49,7 @@ static int brcmf_debug_psm_watchdog_notify(struct brcmf_if *ifp, ...@@ -49,7 +49,7 @@ static int brcmf_debug_psm_watchdog_notify(struct brcmf_if *ifp,
const struct brcmf_event_msg *evtmsg, const struct brcmf_event_msg *evtmsg,
void *data) void *data)
{ {
brcmf_dbg(TRACE, "enter: idx=%d\n", ifp->bssidx); brcmf_dbg(TRACE, "enter: bsscfgidx=%d\n", ifp->bsscfgidx);
return brcmf_debug_create_memdump(ifp->drvr->bus_if, data, return brcmf_debug_create_memdump(ifp->drvr->bus_if, data,
evtmsg->datalen); evtmsg->datalen);
......
...@@ -182,8 +182,8 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr, ...@@ -182,8 +182,8 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
bool is_p2pdev; bool is_p2pdev;
int err = 0; int err = 0;
brcmf_dbg(EVENT, "action: %u idx: %u bsscfg: %u flags: %u role: %u\n", brcmf_dbg(EVENT, "action: %u ifidx: %u bsscfgidx: %u flags: %u role: %u\n",
ifevent->action, ifevent->ifidx, ifevent->bssidx, ifevent->action, ifevent->ifidx, ifevent->bsscfgidx,
ifevent->flags, ifevent->role); ifevent->flags, ifevent->role);
/* The P2P Device interface event must not be ignored contrary to what /* The P2P Device interface event must not be ignored contrary to what
...@@ -204,12 +204,12 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr, ...@@ -204,12 +204,12 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
return; return;
} }
ifp = drvr->iflist[ifevent->bssidx]; ifp = drvr->iflist[ifevent->bsscfgidx];
if (ifevent->action == BRCMF_E_IF_ADD) { if (ifevent->action == BRCMF_E_IF_ADD) {
brcmf_dbg(EVENT, "adding %s (%pM)\n", emsg->ifname, brcmf_dbg(EVENT, "adding %s (%pM)\n", emsg->ifname,
emsg->addr); emsg->addr);
ifp = brcmf_add_if(drvr, ifevent->bssidx, ifevent->ifidx, ifp = brcmf_add_if(drvr, ifevent->bsscfgidx, ifevent->ifidx,
is_p2pdev, emsg->ifname, emsg->addr); is_p2pdev, emsg->ifname, emsg->addr);
if (IS_ERR(ifp)) if (IS_ERR(ifp))
return; return;
......
...@@ -219,7 +219,7 @@ struct brcmf_if_event { ...@@ -219,7 +219,7 @@ struct brcmf_if_event {
u8 ifidx; u8 ifidx;
u8 action; u8 action;
u8 flags; u8 flags;
u8 bssidx; u8 bsscfgidx;
u8 role; u8 role;
}; };
......
...@@ -293,22 +293,22 @@ brcmf_fil_iovar_int_get(struct brcmf_if *ifp, char *name, u32 *data) ...@@ -293,22 +293,22 @@ brcmf_fil_iovar_int_get(struct brcmf_if *ifp, char *name, u32 *data)
} }
static u32 static u32
brcmf_create_bsscfg(s32 bssidx, char *name, char *data, u32 datalen, char *buf, brcmf_create_bsscfg(s32 bsscfgidx, char *name, char *data, u32 datalen,
u32 buflen) char *buf, u32 buflen)
{ {
const s8 *prefix = "bsscfg:"; const s8 *prefix = "bsscfg:";
s8 *p; s8 *p;
u32 prefixlen; u32 prefixlen;
u32 namelen; u32 namelen;
u32 iolen; u32 iolen;
__le32 bssidx_le; __le32 bsscfgidx_le;
if (bssidx == 0) if (bsscfgidx == 0)
return brcmf_create_iovar(name, data, datalen, buf, buflen); return brcmf_create_iovar(name, data, datalen, buf, buflen);
prefixlen = strlen(prefix); prefixlen = strlen(prefix);
namelen = strlen(name) + 1; /* lengh of iovar name + null */ namelen = strlen(name) + 1; /* lengh of iovar name + null */
iolen = prefixlen + namelen + sizeof(bssidx_le) + datalen; iolen = prefixlen + namelen + sizeof(bsscfgidx_le) + datalen;
if (buflen < iolen) { if (buflen < iolen) {
brcmf_err("buffer is too short\n"); brcmf_err("buffer is too short\n");
...@@ -326,9 +326,9 @@ brcmf_create_bsscfg(s32 bssidx, char *name, char *data, u32 datalen, char *buf, ...@@ -326,9 +326,9 @@ brcmf_create_bsscfg(s32 bssidx, char *name, char *data, u32 datalen, char *buf,
p += namelen; p += namelen;
/* bss config index as first data */ /* bss config index as first data */
bssidx_le = cpu_to_le32(bssidx); bsscfgidx_le = cpu_to_le32(bsscfgidx);
memcpy(p, &bssidx_le, sizeof(bssidx_le)); memcpy(p, &bsscfgidx_le, sizeof(bsscfgidx_le));
p += sizeof(bssidx_le); p += sizeof(bsscfgidx_le);
/* parameter buffer follows */ /* parameter buffer follows */
if (datalen) if (datalen)
...@@ -347,12 +347,12 @@ brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, char *name, ...@@ -347,12 +347,12 @@ brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, char *name,
mutex_lock(&drvr->proto_block); mutex_lock(&drvr->proto_block);
brcmf_dbg(FIL, "ifidx=%d, bssidx=%d, name=%s, len=%d\n", ifp->ifidx, brcmf_dbg(FIL, "ifidx=%d, bsscfgidx=%d, name=%s, len=%d\n", ifp->ifidx,
ifp->bssidx, name, len); ifp->bsscfgidx, name, len);
brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data,
min_t(uint, len, MAX_HEX_DUMP_LEN), "data\n"); min_t(uint, len, MAX_HEX_DUMP_LEN), "data\n");
buflen = brcmf_create_bsscfg(ifp->bssidx, name, data, len, buflen = brcmf_create_bsscfg(ifp->bsscfgidx, name, data, len,
drvr->proto_buf, sizeof(drvr->proto_buf)); drvr->proto_buf, sizeof(drvr->proto_buf));
if (buflen) { if (buflen) {
err = brcmf_fil_cmd_data(ifp, BRCMF_C_SET_VAR, drvr->proto_buf, err = brcmf_fil_cmd_data(ifp, BRCMF_C_SET_VAR, drvr->proto_buf,
...@@ -376,7 +376,7 @@ brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name, ...@@ -376,7 +376,7 @@ brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name,
mutex_lock(&drvr->proto_block); mutex_lock(&drvr->proto_block);
buflen = brcmf_create_bsscfg(ifp->bssidx, name, data, len, buflen = brcmf_create_bsscfg(ifp->bsscfgidx, name, data, len,
drvr->proto_buf, sizeof(drvr->proto_buf)); drvr->proto_buf, sizeof(drvr->proto_buf));
if (buflen) { if (buflen) {
err = brcmf_fil_cmd_data(ifp, BRCMF_C_GET_VAR, drvr->proto_buf, err = brcmf_fil_cmd_data(ifp, BRCMF_C_GET_VAR, drvr->proto_buf,
...@@ -387,8 +387,8 @@ brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name, ...@@ -387,8 +387,8 @@ brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name,
err = -EPERM; err = -EPERM;
brcmf_err("Creating bsscfg failed\n"); brcmf_err("Creating bsscfg failed\n");
} }
brcmf_dbg(FIL, "ifidx=%d, bssidx=%d, name=%s, len=%d\n", ifp->ifidx, brcmf_dbg(FIL, "ifidx=%d, bsscfgidx=%d, name=%s, len=%d\n", ifp->ifidx,
ifp->bssidx, name, len); ifp->bsscfgidx, name, len);
brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data, brcmf_dbg_hex_dump(BRCMF_FIL_ON(), data,
min_t(uint, len, MAX_HEX_DUMP_LEN), "data\n"); min_t(uint, len, MAX_HEX_DUMP_LEN), "data\n");
......
...@@ -170,7 +170,7 @@ struct brcmf_fil_af_params_le { ...@@ -170,7 +170,7 @@ struct brcmf_fil_af_params_le {
}; };
struct brcmf_fil_bss_enable_le { struct brcmf_fil_bss_enable_le {
__le32 bsscfg_idx; __le32 bsscfgidx;
__le32 enable; __le32 enable;
}; };
......
...@@ -719,7 +719,7 @@ static void brcmf_fws_macdesc_init(struct brcmf_fws_mac_descriptor *desc, ...@@ -719,7 +719,7 @@ static void brcmf_fws_macdesc_init(struct brcmf_fws_mac_descriptor *desc,
desc->state = BRCMF_FWS_STATE_OPEN; desc->state = BRCMF_FWS_STATE_OPEN;
desc->requested_credit = 0; desc->requested_credit = 0;
desc->requested_packet = 0; desc->requested_packet = 0;
/* depending on use may need ifp->bssidx instead */ /* depending on use may need ifp->bsscfgidx instead */
desc->interface_id = ifidx; desc->interface_id = ifidx;
desc->ac_bitmap = 0xff; /* update this when handling APSD */ desc->ac_bitmap = 0xff; /* update this when handling APSD */
if (addr) if (addr)
...@@ -1938,7 +1938,7 @@ void brcmf_fws_reset_interface(struct brcmf_if *ifp) ...@@ -1938,7 +1938,7 @@ void brcmf_fws_reset_interface(struct brcmf_if *ifp)
{ {
struct brcmf_fws_mac_descriptor *entry = ifp->fws_desc; struct brcmf_fws_mac_descriptor *entry = ifp->fws_desc;
brcmf_dbg(TRACE, "enter: idx=%d\n", ifp->bssidx); brcmf_dbg(TRACE, "enter: bsscfgidx=%d\n", ifp->bsscfgidx);
if (!entry) if (!entry)
return; return;
......
...@@ -2067,7 +2067,7 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p, ...@@ -2067,7 +2067,7 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p,
struct brcmf_if *p2p_ifp; struct brcmf_if *p2p_ifp;
struct brcmf_if *pri_ifp; struct brcmf_if *pri_ifp;
int err; int err;
u32 bssidx; u32 bsscfgidx;
if (p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif) if (p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
return ERR_PTR(-ENOSPC); return ERR_PTR(-ENOSPC);
...@@ -2113,13 +2113,13 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p, ...@@ -2113,13 +2113,13 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p,
memcpy(&p2p_vif->wdev.address, p2p->dev_addr, sizeof(p2p->dev_addr)); memcpy(&p2p_vif->wdev.address, p2p->dev_addr, sizeof(p2p->dev_addr));
/* verify bsscfg index for P2P discovery */ /* verify bsscfg index for P2P discovery */
err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bssidx); err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bsscfgidx);
if (err < 0) { if (err < 0) {
brcmf_err("retrieving discover bsscfg index failed\n"); brcmf_err("retrieving discover bsscfg index failed\n");
goto fail; goto fail;
} }
WARN_ON(p2p_ifp->bssidx != bssidx); WARN_ON(p2p_ifp->bsscfgidx != bsscfgidx);
init_completion(&p2p->send_af_done); init_completion(&p2p->send_af_done);
INIT_WORK(&p2p->afx_hdl.afx_work, brcmf_p2p_afx_handler); INIT_WORK(&p2p->afx_hdl.afx_work, brcmf_p2p_afx_handler);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment