brcmsmac: activate AP support
This activates the AP mode support. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
04d2e422df
commit
492b71e8d4
@ -357,10 +357,11 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
|||||||
{
|
{
|
||||||
struct brcms_info *wl = hw->priv;
|
struct brcms_info *wl = hw->priv;
|
||||||
|
|
||||||
/* Just STA for now */
|
/* Just STA and AP for now */
|
||||||
if (vif->type != NL80211_IFTYPE_STATION) {
|
if (vif->type != NL80211_IFTYPE_STATION &&
|
||||||
|
vif->type != NL80211_IFTYPE_AP) {
|
||||||
brcms_err(wl->wlc->hw->d11core,
|
brcms_err(wl->wlc->hw->d11core,
|
||||||
"%s: Attempt to add type %d, only STA for now\n",
|
"%s: Attempt to add type %d, only STA and AP for now\n",
|
||||||
__func__, vif->type);
|
__func__, vif->type);
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
@ -370,6 +371,9 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
|||||||
brcms_c_mute(wl->wlc, false);
|
brcms_c_mute(wl->wlc, false);
|
||||||
if (vif->type == NL80211_IFTYPE_STATION)
|
if (vif->type == NL80211_IFTYPE_STATION)
|
||||||
brcms_c_start_station(wl->wlc, vif->addr);
|
brcms_c_start_station(wl->wlc, vif->addr);
|
||||||
|
else if (vif->type == NL80211_IFTYPE_AP)
|
||||||
|
brcms_c_start_ap(wl->wlc, vif->addr, vif->bss_conf.bssid,
|
||||||
|
vif->bss_conf.ssid, vif->bss_conf.ssid_len);
|
||||||
spin_unlock_bh(&wl->lock);
|
spin_unlock_bh(&wl->lock);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1051,7 +1055,8 @@ static int ieee_hw_init(struct ieee80211_hw *hw)
|
|||||||
|
|
||||||
/* channel change time is dependent on chip and band */
|
/* channel change time is dependent on chip and band */
|
||||||
hw->channel_change_time = 7 * 1000;
|
hw->channel_change_time = 7 * 1000;
|
||||||
hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
|
hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
|
||||||
|
BIT(NL80211_IFTYPE_AP);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* deactivate sending probe responses by ucude, because this will
|
* deactivate sending probe responses by ucude, because this will
|
||||||
|
@ -2174,6 +2174,18 @@ void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr)
|
|||||||
wlc->bsscfg->type = BRCMS_TYPE_STATION;
|
wlc->bsscfg->type = BRCMS_TYPE_STATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr, const u8 *bssid,
|
||||||
|
u8 *ssid, size_t ssid_len)
|
||||||
|
{
|
||||||
|
brcms_c_set_ssid(wlc, ssid, ssid_len);
|
||||||
|
|
||||||
|
memcpy(wlc->pub->cur_etheraddr, addr, sizeof(wlc->pub->cur_etheraddr));
|
||||||
|
memcpy(wlc->bsscfg->BSSID, bssid, sizeof(wlc->bsscfg->BSSID));
|
||||||
|
wlc->bsscfg->type = BRCMS_TYPE_AP;
|
||||||
|
|
||||||
|
brcms_b_mctrl(wlc->hw, MCTL_AP | MCTL_INFRA, MCTL_AP | MCTL_INFRA);
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize GPIOs that are controlled by D11 core */
|
/* Initialize GPIOs that are controlled by D11 core */
|
||||||
static void brcms_c_gpio_init(struct brcms_c_info *wlc)
|
static void brcms_c_gpio_init(struct brcms_c_info *wlc)
|
||||||
{
|
{
|
||||||
@ -3062,6 +3074,9 @@ static bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
|
|||||||
if (wlc->filter_flags & FIF_PROMISC_IN_BSS)
|
if (wlc->filter_flags & FIF_PROMISC_IN_BSS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (wlc->bsscfg->type == BRCMS_TYPE_AP)
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,6 +332,8 @@ extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
|
|||||||
extern void brcms_c_mute(struct brcms_c_info *wlc, bool on);
|
extern void brcms_c_mute(struct brcms_c_info *wlc, bool on);
|
||||||
extern bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
|
extern bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
|
||||||
extern void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
|
extern void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
|
||||||
|
extern void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr,
|
||||||
|
const u8 *bssid, u8 *ssid, size_t ssid_len);
|
||||||
extern void brcms_c_update_beacon(struct brcms_c_info *wlc);
|
extern void brcms_c_update_beacon(struct brcms_c_info *wlc);
|
||||||
extern void brcms_c_set_new_beacon(struct brcms_c_info *wlc,
|
extern void brcms_c_set_new_beacon(struct brcms_c_info *wlc,
|
||||||
struct sk_buff *beacon, u16 tim_offset,
|
struct sk_buff *beacon, u16 tim_offset,
|
||||||
|
Loading…
Reference in New Issue
Block a user