aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/cmd.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-10-10 04:13:13 -0400
committerLuciano Coelho <coelho@ti.com>2011-10-11 08:12:13 -0400
commit6e8cd3310491b10db20d0f7eaf5713b05fa7b753 (patch)
tree45022c388445ae10ab24f2ad08a247060effbc88 /drivers/net/wireless/wl12xx/cmd.c
parent9f259c4e5e42d5f0c25675dc1088cd96dc81a9f1 (diff)
wl12xx: replace all remaining wl->vif references
wl->vif is appropriate only when a single vif is being used. Instead, pass wlvif as parameter or iterate through all the vifs (e.g. when a global configuration was changed) Leave wl->vif only to determine whether a vif was already added (this check will be removed as well after both the driver and fw will support multiple vifs) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/cmd.c')
-rw-r--r--drivers/net/wireless/wl12xx/cmd.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index 4c5c51810fda..65bf9526576d 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -654,7 +654,8 @@ out:
654int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) 654int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif)
655{ 655{
656 struct wl12xx_cmd_role_start *cmd; 656 struct wl12xx_cmd_role_start *cmd;
657 struct ieee80211_bss_conf *bss_conf = &wl->vif->bss_conf; 657 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
658 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
658 int ret; 659 int ret;
659 660
660 wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wlvif->role_id); 661 wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wlvif->role_id);
@@ -773,7 +774,7 @@ int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif)
773{ 774{
774 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); 775 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
775 struct wl12xx_cmd_role_start *cmd; 776 struct wl12xx_cmd_role_start *cmd;
776 struct ieee80211_bss_conf *bss_conf = &wl->vif->bss_conf; 777 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
777 int ret; 778 int ret;
778 779
779 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); 780 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
@@ -1096,10 +1097,11 @@ out:
1096int wl1271_cmd_build_ps_poll(struct wl1271 *wl, struct wl12xx_vif *wlvif, 1097int wl1271_cmd_build_ps_poll(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1097 u16 aid) 1098 u16 aid)
1098{ 1099{
1100 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
1099 struct sk_buff *skb; 1101 struct sk_buff *skb;
1100 int ret = 0; 1102 int ret = 0;
1101 1103
1102 skb = ieee80211_pspoll_get(wl->hw, wl->vif); 1104 skb = ieee80211_pspoll_get(wl->hw, vif);
1103 if (!skb) 1105 if (!skb)
1104 goto out; 1106 goto out;
1105 1107
@@ -1176,6 +1178,7 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1176 __be32 ip_addr) 1178 __be32 ip_addr)
1177{ 1179{
1178 int ret; 1180 int ret;
1181 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
1179 struct wl12xx_arp_rsp_template tmpl; 1182 struct wl12xx_arp_rsp_template tmpl;
1180 struct ieee80211_hdr_3addr *hdr; 1183 struct ieee80211_hdr_3addr *hdr;
1181 struct arphdr *arp_hdr; 1184 struct arphdr *arp_hdr;
@@ -1187,8 +1190,8 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1187 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA | 1190 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA |
1188 IEEE80211_STYPE_DATA | 1191 IEEE80211_STYPE_DATA |
1189 IEEE80211_FCTL_TODS); 1192 IEEE80211_FCTL_TODS);
1190 memcpy(hdr->addr1, wl->vif->bss_conf.bssid, ETH_ALEN); 1193 memcpy(hdr->addr1, vif->bss_conf.bssid, ETH_ALEN);
1191 memcpy(hdr->addr2, wl->vif->addr, ETH_ALEN); 1194 memcpy(hdr->addr2, vif->addr, ETH_ALEN);
1192 memset(hdr->addr3, 0xff, ETH_ALEN); 1195 memset(hdr->addr3, 0xff, ETH_ALEN);
1193 1196
1194 /* llc layer */ 1197 /* llc layer */
@@ -1204,7 +1207,7 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1204 arp_hdr->ar_op = cpu_to_be16(ARPOP_REPLY); 1207 arp_hdr->ar_op = cpu_to_be16(ARPOP_REPLY);
1205 1208
1206 /* arp payload */ 1209 /* arp payload */
1207 memcpy(tmpl.sender_hw, wl->vif->addr, ETH_ALEN); 1210 memcpy(tmpl.sender_hw, vif->addr, ETH_ALEN);
1208 tmpl.sender_ip = ip_addr; 1211 tmpl.sender_ip = ip_addr;
1209 1212
1210 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_ARP_RSP, 1213 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_ARP_RSP,