20 #include <linux/slab.h>
23 #include <linux/module.h>
30 static bool modparam_nohwcrypt;
83 if (skb->
len <=
sizeof(mgmt))
86 pos = (
u8 *)mgmt->
u.beacon.variable;
89 if (pos + 2 + pos[1] >
end)
100 static int p54_beacon_format_ie_tim(
struct sk_buff *
skb)
117 dtim_period = tim[3];
118 next = tim + 2 + dtim_len;
123 memmove(tim, next, skb_tail_pointer(skb) - next);
124 tim = skb_tail_pointer(skb) - (dtim_len + 2);
139 static int p54_beacon_update(
struct p54_common *priv,
146 beacon = ieee80211_beacon_get(priv->
hw, vif);
149 ret = p54_beacon_format_ie_tim(beacon);
175 err = priv->
open(dev);
261 static void p54_remove_interface(
struct ieee80211_hw *dev,
301 static void p54_reset_stats(
struct p54_common *priv)
331 WARN_ON(p54_wait_for_stats(dev));
344 p54_reset_stats(priv);
348 WARN_ON(p54_wait_for_stats(dev));
352 WARN_ON(p54_wait_for_stats(dev));
355 WARN_ON(p54_wait_for_stats(dev));
359 WARN_ON(p54_wait_for_stats(dev));
392 static void p54_configure_filter(
struct ieee80211_hw *dev,
393 unsigned int changed_flags,
394 unsigned int *total_flags,
458 static void p54_bss_info_changed(
struct ieee80211_hw *dev,
474 p54_beacon_update(priv, vif);
488 if (priv->
fw_var >= 0x500)
515 if (modparam_nohwcrypt)
622 for (tries = 0; tries <
MAX_TRIES; tries++) {
624 if (chan && chan->
hw_value == idx) {
626 err = p54_wait_for_stats(dev);
657 static unsigned int p54_flush_count(
struct p54_common *priv)
659 unsigned int total = 0,
i;
673 static void p54_flush(
struct ieee80211_hw *dev,
bool drop)
676 unsigned int total,
i;
691 while ((total = p54_flush_count(priv) && i--)) {
696 WARN(total,
"tx flush timeout, unresponsive firmware");
714 .add_interface = p54_add_interface,
715 .remove_interface = p54_remove_interface,
716 .set_tim = p54_set_tim,
717 .sta_notify = p54_sta_notify,
718 .sta_add = p54_sta_add_remove,
719 .sta_remove = p54_sta_add_remove,
720 .set_key = p54_set_key,
721 .config = p54_config,
723 .bss_info_changed = p54_bss_info_changed,
724 .prepare_multicast = p54_prepare_multicast,
725 .configure_filter = p54_configure_filter,
726 .conf_tx = p54_conf_tx,
727 .get_stats = p54_get_stats,
728 .get_survey = p54_get_survey,
729 .set_coverage_class = p54_set_coverage_class,
746 skb_queue_head_init(&priv->
tx_queue);
780 sizeof(struct p54_tx_data);
797 p54_reset_stats(priv);
809 dev_err(pdev,
"Cannot register device (%d).\n", err);
814 #ifdef CONFIG_P54_LEDS
822 dev_info(pdev,
"is registered as '%s'\n", wiphy_name(dev->
wiphy));
855 #ifdef CONFIG_P54_LEDS