• Home
  • Raw
  • Download

Lines Matching refs:wlvif

460 int wl12xx_allocate_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid)  in wl12xx_allocate_link()  argument
470 __set_bit(link, wlvif->links_map); in wl12xx_allocate_link()
476 void wl12xx_free_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid) in wl12xx_free_link() argument
486 __clear_bit(*hlid, wlvif->links_map); in wl12xx_free_link()
499 struct wl12xx_vif *wlvif) in wl12xx_get_new_session_id() argument
501 if (wlvif->session_counter >= SESSION_COUNTER_MAX) in wl12xx_get_new_session_id()
502 wlvif->session_counter = 0; in wl12xx_get_new_session_id()
504 wlvif->session_counter++; in wl12xx_get_new_session_id()
506 return wlvif->session_counter; in wl12xx_get_new_session_id()
510 struct wl12xx_vif *wlvif) in wl12xx_cmd_role_start_dev() argument
521 wl1271_debug(DEBUG_CMD, "cmd role start dev %d", wlvif->dev_role_id); in wl12xx_cmd_role_start_dev()
523 cmd->role_id = wlvif->dev_role_id; in wl12xx_cmd_role_start_dev()
524 if (wlvif->band == IEEE80211_BAND_5GHZ) in wl12xx_cmd_role_start_dev()
526 cmd->channel = wlvif->channel; in wl12xx_cmd_role_start_dev()
528 if (wlvif->dev_hlid == WL12XX_INVALID_LINK_ID) { in wl12xx_cmd_role_start_dev()
529 ret = wl12xx_allocate_link(wl, wlvif, &wlvif->dev_hlid); in wl12xx_cmd_role_start_dev()
533 cmd->device.hlid = wlvif->dev_hlid; in wl12xx_cmd_role_start_dev()
534 cmd->device.session = wl12xx_get_new_session_id(wl, wlvif); in wl12xx_cmd_role_start_dev()
549 wl12xx_free_link(wl, wlvif, &wlvif->dev_hlid); in wl12xx_cmd_role_start_dev()
559 struct wl12xx_vif *wlvif) in wl12xx_cmd_role_stop_dev() argument
564 if (WARN_ON(wlvif->dev_hlid == WL12XX_INVALID_LINK_ID)) in wl12xx_cmd_role_stop_dev()
575 cmd->role_id = wlvif->dev_role_id; in wl12xx_cmd_role_stop_dev()
591 wl12xx_free_link(wl, wlvif, &wlvif->dev_hlid); in wl12xx_cmd_role_stop_dev()
600 int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif) in wl12xx_cmd_role_start_sta() argument
602 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); in wl12xx_cmd_role_start_sta()
612 wl1271_debug(DEBUG_CMD, "cmd role start sta %d", wlvif->role_id); in wl12xx_cmd_role_start_sta()
614 cmd->role_id = wlvif->role_id; in wl12xx_cmd_role_start_sta()
615 if (wlvif->band == IEEE80211_BAND_5GHZ) in wl12xx_cmd_role_start_sta()
617 cmd->channel = wlvif->channel; in wl12xx_cmd_role_start_sta()
618 cmd->sta.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set); in wl12xx_cmd_role_start_sta()
619 cmd->sta.beacon_interval = cpu_to_le16(wlvif->beacon_int); in wl12xx_cmd_role_start_sta()
621 cmd->sta.ssid_len = wlvif->ssid_len; in wl12xx_cmd_role_start_sta()
622 memcpy(cmd->sta.ssid, wlvif->ssid, wlvif->ssid_len); in wl12xx_cmd_role_start_sta()
624 cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set); in wl12xx_cmd_role_start_sta()
626 if (wlvif->sta.hlid == WL12XX_INVALID_LINK_ID) { in wl12xx_cmd_role_start_sta()
627 ret = wl12xx_allocate_link(wl, wlvif, &wlvif->sta.hlid); in wl12xx_cmd_role_start_sta()
631 cmd->sta.hlid = wlvif->sta.hlid; in wl12xx_cmd_role_start_sta()
632 cmd->sta.session = wl12xx_get_new_session_id(wl, wlvif); in wl12xx_cmd_role_start_sta()
633 cmd->sta.remote_rates = cpu_to_le32(wlvif->rate_set); in wl12xx_cmd_role_start_sta()
637 wlvif->role_id, cmd->sta.hlid, cmd->sta.session, in wl12xx_cmd_role_start_sta()
638 wlvif->basic_rate_set, wlvif->rate_set); in wl12xx_cmd_role_start_sta()
650 wl12xx_free_link(wl, wlvif, &wlvif->sta.hlid); in wl12xx_cmd_role_start_sta()
660 int wl12xx_cmd_role_stop_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif) in wl12xx_cmd_role_stop_sta() argument
665 if (WARN_ON(wlvif->sta.hlid == WL12XX_INVALID_LINK_ID)) in wl12xx_cmd_role_stop_sta()
674 wl1271_debug(DEBUG_CMD, "cmd role stop sta %d", wlvif->role_id); in wl12xx_cmd_role_stop_sta()
676 cmd->role_id = wlvif->role_id; in wl12xx_cmd_role_stop_sta()
686 wl12xx_free_link(wl, wlvif, &wlvif->sta.hlid); in wl12xx_cmd_role_stop_sta()
695 int wl12xx_cmd_role_start_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) in wl12xx_cmd_role_start_ap() argument
698 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); in wl12xx_cmd_role_start_ap()
702 wl1271_debug(DEBUG_CMD, "cmd role start ap %d", wlvif->role_id); in wl12xx_cmd_role_start_ap()
705 if (wlvif->ssid_len == 0 && !bss_conf->hidden_ssid) { in wl12xx_cmd_role_start_ap()
717 ret = wl12xx_allocate_link(wl, wlvif, &wlvif->ap.global_hlid); in wl12xx_cmd_role_start_ap()
721 ret = wl12xx_allocate_link(wl, wlvif, &wlvif->ap.bcast_hlid); in wl12xx_cmd_role_start_ap()
725 cmd->role_id = wlvif->role_id; in wl12xx_cmd_role_start_ap()
728 cmd->ap.global_hlid = wlvif->ap.global_hlid; in wl12xx_cmd_role_start_ap()
729 cmd->ap.broadcast_hlid = wlvif->ap.bcast_hlid; in wl12xx_cmd_role_start_ap()
730 cmd->ap.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set); in wl12xx_cmd_role_start_ap()
731 cmd->ap.beacon_interval = cpu_to_le16(wlvif->beacon_int); in wl12xx_cmd_role_start_ap()
736 cmd->channel = wlvif->channel; in wl12xx_cmd_role_start_ap()
741 cmd->ap.ssid_len = wlvif->ssid_len; in wl12xx_cmd_role_start_ap()
742 memcpy(cmd->ap.ssid, wlvif->ssid, wlvif->ssid_len); in wl12xx_cmd_role_start_ap()
751 switch (wlvif->band) { in wl12xx_cmd_role_start_ap()
759 wl1271_warning("ap start - unknown band: %d", (int)wlvif->band); in wl12xx_cmd_role_start_ap()
773 wl12xx_free_link(wl, wlvif, &wlvif->ap.bcast_hlid); in wl12xx_cmd_role_start_ap()
776 wl12xx_free_link(wl, wlvif, &wlvif->ap.global_hlid); in wl12xx_cmd_role_start_ap()
785 int wl12xx_cmd_role_stop_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif) in wl12xx_cmd_role_stop_ap() argument
796 wl1271_debug(DEBUG_CMD, "cmd role stop ap %d", wlvif->role_id); in wl12xx_cmd_role_stop_ap()
798 cmd->role_id = wlvif->role_id; in wl12xx_cmd_role_stop_ap()
806 wl12xx_free_link(wl, wlvif, &wlvif->ap.bcast_hlid); in wl12xx_cmd_role_stop_ap()
807 wl12xx_free_link(wl, wlvif, &wlvif->ap.global_hlid); in wl12xx_cmd_role_stop_ap()
816 int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif) in wl12xx_cmd_role_start_ibss() argument
818 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); in wl12xx_cmd_role_start_ibss()
829 wl1271_debug(DEBUG_CMD, "cmd role start ibss %d", wlvif->role_id); in wl12xx_cmd_role_start_ibss()
831 cmd->role_id = wlvif->role_id; in wl12xx_cmd_role_start_ibss()
832 if (wlvif->band == IEEE80211_BAND_5GHZ) in wl12xx_cmd_role_start_ibss()
834 cmd->channel = wlvif->channel; in wl12xx_cmd_role_start_ibss()
835 cmd->ibss.basic_rate_set = cpu_to_le32(wlvif->basic_rate_set); in wl12xx_cmd_role_start_ibss()
836 cmd->ibss.beacon_interval = cpu_to_le16(wlvif->beacon_int); in wl12xx_cmd_role_start_ibss()
839 cmd->ibss.ssid_len = wlvif->ssid_len; in wl12xx_cmd_role_start_ibss()
840 memcpy(cmd->ibss.ssid, wlvif->ssid, wlvif->ssid_len); in wl12xx_cmd_role_start_ibss()
842 cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set); in wl12xx_cmd_role_start_ibss()
844 if (wlvif->sta.hlid == WL12XX_INVALID_LINK_ID) { in wl12xx_cmd_role_start_ibss()
845 ret = wl12xx_allocate_link(wl, wlvif, &wlvif->sta.hlid); in wl12xx_cmd_role_start_ibss()
849 cmd->ibss.hlid = wlvif->sta.hlid; in wl12xx_cmd_role_start_ibss()
850 cmd->ibss.remote_rates = cpu_to_le32(wlvif->rate_set); in wl12xx_cmd_role_start_ibss()
854 wlvif->role_id, cmd->sta.hlid, cmd->sta.session, in wl12xx_cmd_role_start_ibss()
855 wlvif->basic_rate_set, wlvif->rate_set); in wl12xx_cmd_role_start_ibss()
870 wl12xx_free_link(wl, wlvif, &wlvif->sta.hlid); in wl12xx_cmd_role_start_ibss()
1014 int wl1271_cmd_ps_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl1271_cmd_ps_mode() argument
1028 ps_params->role_id = wlvif->role_id; in wl1271_cmd_ps_mode()
1088 int wl12xx_cmd_build_null_data(struct wl1271 *wl, struct wl12xx_vif *wlvif) in wl12xx_cmd_build_null_data() argument
1096 if (wlvif->bss_type == BSS_TYPE_IBSS) { in wl12xx_cmd_build_null_data()
1101 wl12xx_wlvif_to_vif(wlvif)); in wl12xx_cmd_build_null_data()
1108 ret = wl1271_cmd_template_set(wl, wlvif->role_id, in wl12xx_cmd_build_null_data()
1110 wlvif->basic_rate); in wl12xx_cmd_build_null_data()
1122 struct wl12xx_vif *wlvif) in wl12xx_cmd_build_klv_null_data() argument
1124 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); in wl12xx_cmd_build_klv_null_data()
1132 ret = wl1271_cmd_template_set(wl, wlvif->role_id, CMD_TEMPL_KLV, in wl12xx_cmd_build_klv_null_data()
1135 wlvif->basic_rate); in wl12xx_cmd_build_klv_null_data()
1146 int wl1271_cmd_build_ps_poll(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl1271_cmd_build_ps_poll() argument
1149 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); in wl1271_cmd_build_ps_poll()
1157 ret = wl1271_cmd_template_set(wl, wlvif->role_id, in wl1271_cmd_build_ps_poll()
1159 skb->len, 0, wlvif->basic_rate_set); in wl1271_cmd_build_ps_poll()
1166 int wl12xx_cmd_build_probe_req(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl12xx_cmd_build_probe_req() argument
1171 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); in wl12xx_cmd_build_probe_req()
1185 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[band]); in wl12xx_cmd_build_probe_req()
1201 struct wl12xx_vif *wlvif, in wl1271_cmd_build_ap_probe_req() argument
1204 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); in wl1271_cmd_build_ap_probe_req()
1215 rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[wlvif->band]); in wl1271_cmd_build_ap_probe_req()
1216 if (wlvif->band == IEEE80211_BAND_2GHZ) in wl1271_cmd_build_ap_probe_req()
1217 ret = wl1271_cmd_template_set(wl, wlvif->role_id, in wl1271_cmd_build_ap_probe_req()
1221 ret = wl1271_cmd_template_set(wl, wlvif->role_id, in wl1271_cmd_build_ap_probe_req()
1232 int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif) in wl1271_cmd_build_arp_rsp() argument
1236 struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); in wl1271_cmd_build_arp_rsp()
1268 tmpl->sender_ip = wlvif->ip_addr; in wl1271_cmd_build_arp_rsp()
1271 switch (wlvif->encryption_type) { in wl1271_cmd_build_arp_rsp()
1285 wlvif->encryption_type); in wl1271_cmd_build_arp_rsp()
1296 if (wlvif->sta.qos) in wl1271_cmd_build_arp_rsp()
1303 if (wlvif->sta.qos) in wl1271_cmd_build_arp_rsp()
1307 if (wlvif->encryption_type != KEY_NONE) in wl1271_cmd_build_arp_rsp()
1315 ret = wl1271_cmd_template_set(wl, wlvif->role_id, CMD_TEMPL_ARP_RSP, in wl1271_cmd_build_arp_rsp()
1317 wlvif->basic_rate); in wl1271_cmd_build_arp_rsp()
1325 struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); in wl1271_build_qos_null_data() local
1341 return wl1271_cmd_template_set(wl, wlvif->role_id, in wl1271_build_qos_null_data()
1344 wlvif->basic_rate); in wl1271_build_qos_null_data()
1378 int wl1271_cmd_set_sta_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl1271_cmd_set_sta_key() argument
1387 if (wlvif->sta.hlid == WL12XX_INVALID_LINK_ID) in wl1271_cmd_set_sta_key()
1396 cmd->hlid = wlvif->sta.hlid; in wl1271_cmd_set_sta_key()
1447 int wl1271_cmd_set_ap_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl1271_cmd_set_ap_key() argument
1460 if (hlid == wlvif->ap.bcast_hlid) { in wl1271_cmd_set_ap_key()
1538 int wl12xx_cmd_add_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl12xx_cmd_add_peer() argument
1566 sta_rates = sta->supp_rates[wlvif->band]; in wl12xx_cmd_add_peer()
1572 wlvif->band)); in wl12xx_cmd_add_peer()
1712 static int wl12xx_cmd_roc(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl12xx_cmd_roc() argument
1718 wl1271_debug(DEBUG_CMD, "cmd roc %d (%d)", wlvif->channel, role_id); in wl12xx_cmd_roc()
1730 cmd->channel = wlvif->channel; in wl12xx_cmd_roc()
1731 switch (wlvif->band) { in wl12xx_cmd_roc()
1739 wl1271_error("roc - unknown band: %d", (int)wlvif->band); in wl12xx_cmd_roc()
1786 int wl12xx_roc(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 role_id) in wl12xx_roc() argument
1793 ret = wl12xx_cmd_roc(wl, wlvif, role_id); in wl12xx_roc()
1834 struct wl12xx_vif *wlvif, in wl12xx_cmd_channel_switch() argument
1848 cmd->role_id = wlvif->role_id; in wl12xx_cmd_channel_switch()
1896 int wl12xx_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif) in wl12xx_start_dev() argument
1900 if (WARN_ON(!(wlvif->bss_type == BSS_TYPE_STA_BSS || in wl12xx_start_dev()
1901 wlvif->bss_type == BSS_TYPE_IBSS))) in wl12xx_start_dev()
1904 ret = wl12xx_cmd_role_start_dev(wl, wlvif); in wl12xx_start_dev()
1908 ret = wl12xx_roc(wl, wlvif, wlvif->dev_role_id); in wl12xx_start_dev()
1915 wl12xx_cmd_role_stop_dev(wl, wlvif); in wl12xx_start_dev()
1921 int wl12xx_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif) in wl12xx_stop_dev() argument
1925 if (WARN_ON(!(wlvif->bss_type == BSS_TYPE_STA_BSS || in wl12xx_stop_dev()
1926 wlvif->bss_type == BSS_TYPE_IBSS))) in wl12xx_stop_dev()
1932 if (test_bit(wlvif->dev_role_id, wl->roc_map)) { in wl12xx_stop_dev()
1933 ret = wl12xx_croc(wl, wlvif->dev_role_id); in wl12xx_stop_dev()
1938 ret = wl12xx_cmd_role_stop_dev(wl, wlvif); in wl12xx_stop_dev()