10 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13 #include <linux/slab.h>
16 #include <linux/module.h>
19 #define DRIVER_RELEASE_VERSION "004.p0"
21 #define LBTF_FW_VER_MIN 0x05840300
22 #define LBTF_FW_VER_MAX 0x0584ffff
23 #define QOS_CONTROL_LEN 2
39 { .center_freq = 2412, .hw_value = 1 },
40 { .center_freq = 2417, .hw_value = 2 },
41 { .center_freq = 2422, .hw_value = 3 },
42 { .center_freq = 2427, .hw_value = 4 },
43 { .center_freq = 2432, .hw_value = 5 },
44 { .center_freq = 2437, .hw_value = 6 },
45 { .center_freq = 2442, .hw_value = 7 },
46 { .center_freq = 2447, .hw_value = 8 },
47 { .center_freq = 2452, .hw_value = 9 },
48 { .center_freq = 2457, .hw_value = 10 },
49 { .center_freq = 2462, .hw_value = 11 },
50 { .center_freq = 2467, .hw_value = 12 },
51 { .center_freq = 2472, .hw_value = 13 },
52 { .center_freq = 2484, .hw_value = 14 },
147 static int lbtf_setup_firmware(
struct lbtf_private *priv)
175 static void command_timer_fn(
unsigned long data)
185 "no pending command\n");
207 (
unsigned long)priv);
222 static void lbtf_free_adapter(
struct lbtf_private *priv)
269 info = IEEE80211_SKB_CB(skb);
270 txpd = (
struct txpd *)
skb_push(skb,
sizeof(
struct txpd));
278 memset(txpd, 0,
sizeof(
struct txpd));
281 ieee80211_get_tx_rate(priv->
hw, info)->hw_value);
297 pr_err(
"TX error: %d", err);
313 goto err_prog_firmware;
319 ret = lbtf_setup_firmware(priv);
321 goto err_prog_firmware;
326 goto err_prog_firmware;
329 printk(
KERN_INFO "libertastf: Marvell WLAN 802.11 thinfirm adapter\n");
368 static int lbtf_op_add_interface(
struct ieee80211_hw *hw,
394 static void lbtf_op_remove_interface(
struct ieee80211_hw *hw,
442 #define SUPPORTED_FIF_FLAGS (FIF_PROMISC_IN_BSS | FIF_ALLMULTI)
443 static void lbtf_op_configure_filter(
struct ieee80211_hw *hw,
444 unsigned int changed_flags,
445 unsigned int *new_flags,
456 if (!changed_flags) {
469 }
else if (multicast) {
489 static void lbtf_op_bss_info_changed(
struct ieee80211_hw *hw,
499 switch (priv->
vif->type) {
502 beacon = ieee80211_beacon_get(hw, vif);
516 bool activate = !is_zero_ether_addr(bss_conf->
bssid);
549 .start = lbtf_op_start,
550 .stop = lbtf_op_stop,
551 .add_interface = lbtf_op_add_interface,
552 .remove_interface = lbtf_op_remove_interface,
553 .config = lbtf_op_config,
554 .prepare_multicast = lbtf_op_prepare_multicast,
555 .configure_filter = lbtf_op_configure_filter,
556 .bss_info_changed = lbtf_op_bss_info_changed,
557 .get_survey = lbtf_op_get_survey,
572 memset(&stats, 0,
sizeof(stats));
591 (*ieee80211_get_qos_ctl(hdr) &
599 memcpy(IEEE80211_SKB_RXCB(skb), &stats,
sizeof(stats));
601 lbtf_deb_rx(
"rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n",
604 min_t(
unsigned int, skb->
len, 100));
632 if (lbtf_init_adapter(priv))
633 goto err_init_adapter;
643 memcpy(priv->
rates, lbtf_rates,
sizeof(lbtf_rates));
649 hw->
wiphy->interface_modes =
654 SET_IEEE80211_DEV(hw, dmdev);
659 goto err_init_adapter;
664 lbtf_free_adapter(priv);
683 lbtf_free_adapter(priv);
697 ieee80211_tx_info_clear_status(info);
724 bool tx_buff_bc =
false;
736 skb = ieee80211_beacon_get(priv->
hw, priv->
vif);
745 static int __init lbtf_init_module(
void)
749 if (lbtf_wq ==
NULL) {
757 static void __exit lbtf_exit_module(
void)