]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-bsp/linux/linux-omap/wl1271/0003-wl1271-11n-Support-ACX-Commands.patch
netbase: automatically bring up usb0 on BeagleBoard xM
[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap / wl1271 / 0003-wl1271-11n-Support-ACX-Commands.patch
1 From 160169e1e717020b8456278950c30d2b1f15c314 Mon Sep 17 00:00:00 2001
2 From: Shahar Levi <shahar_levi@ti.com>
3 Date: Wed, 13 Oct 2010 16:09:40 +0200
4 Subject: [PATCH 03/15] wl1271: 11n Support, ACX Commands
6 Added ACX command to the FW for 11n support.
8 Signed-off-by: Shahar Levi <shahar_levi@ti.com>
9 Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
10 Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
11 ---
12  drivers/net/wireless/wl12xx/wl1271_acx.c |   83 ++++++++++++++++++++++++++++++
13  drivers/net/wireless/wl12xx/wl1271_acx.h |    5 ++
14  2 files changed, 88 insertions(+), 0 deletions(-)
16 diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
17 index 6189934..bd7f95f 100644
18 --- a/drivers/net/wireless/wl12xx/wl1271_acx.c
19 +++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
20 @@ -1226,6 +1226,89 @@ out:
21         return ret;
22  }
23  
24 +int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
25 +                                   struct ieee80211_sta_ht_cap *ht_cap,
26 +                                   bool allow_ht_operation)
27 +{
28 +       struct wl1271_acx_ht_capabilities *acx;
29 +       u8 mac_address[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
30 +       int ret = 0;
31 +
32 +       wl1271_debug(DEBUG_ACX, "acx ht capabilities setting");
33 +
34 +       acx = kzalloc(sizeof(*acx), GFP_KERNEL);
35 +       if (!acx) {
36 +               ret = -ENOMEM;
37 +               goto out;
38 +       }
39 +
40 +       /* Allow HT Operation ? */
41 +       if (allow_ht_operation) {
42 +               acx->ht_capabilites =
43 +                       WL1271_ACX_FW_CAP_HT_OPERATION;
44 +               if (ht_cap->cap & IEEE80211_HT_CAP_GRN_FLD)
45 +                       acx->ht_capabilites |=
46 +                               WL1271_ACX_FW_CAP_GREENFIELD_FRAME_FORMAT;
47 +               if (ht_cap->cap & IEEE80211_HT_CAP_SGI_20)
48 +                       acx->ht_capabilites |=
49 +                               WL1271_ACX_FW_CAP_SHORT_GI_FOR_20MHZ_PACKETS;
50 +               if (ht_cap->cap & IEEE80211_HT_CAP_LSIG_TXOP_PROT)
51 +                       acx->ht_capabilites |=
52 +                               WL1271_ACX_FW_CAP_LSIG_TXOP_PROTECTION;
53 +
54 +               /* get data from A-MPDU parameters field */
55 +               acx->ampdu_max_length = ht_cap->ampdu_factor;
56 +               acx->ampdu_min_spacing = ht_cap->ampdu_density;
57 +
58 +               memcpy(acx->mac_address, mac_address, ETH_ALEN);
59 +       } else { /* HT operations are not allowed */
60 +               acx->ht_capabilites = 0;
61 +       }
62 +
63 +       ret = wl1271_cmd_configure(wl, ACX_PEER_HT_CAP, acx, sizeof(*acx));
64 +       if (ret < 0) {
65 +               wl1271_warning("acx ht capabilities setting failed: %d", ret);
66 +               goto out;
67 +       }
68 +
69 +out:
70 +       kfree(acx);
71 +       return ret;
72 +}
73 +
74 +int wl1271_acx_set_ht_information(struct wl1271 *wl,
75 +                                  u16 ht_operation_mode)
76 +{
77 +       struct wl1271_acx_ht_information *acx;
78 +       int ret = 0;
79 +
80 +       wl1271_debug(DEBUG_ACX, "acx ht information setting");
81 +
82 +       acx = kzalloc(sizeof(*acx), GFP_KERNEL);
83 +       if (!acx) {
84 +               ret = -ENOMEM;
85 +               goto out;
86 +       }
87 +
88 +       acx->ht_protection =
89 +               (u8)(ht_operation_mode & IEEE80211_HT_OP_MODE_PROTECTION);
90 +       acx->rifs_mode = 0;
91 +       acx->gf_protection = 0;
92 +       acx->ht_tx_burst_limit = 0;
93 +       acx->dual_cts_protection = 0;
94 +
95 +       ret = wl1271_cmd_configure(wl, ACX_HT_BSS_OPERATION, acx, sizeof(*acx));
96 +
97 +       if (ret < 0) {
98 +               wl1271_warning("acx ht information setting failed: %d", ret);
99 +               goto out;
100 +       }
102 +out:
103 +       kfree(acx);
104 +       return ret;
105 +}
107  int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime)
108  {
109         struct wl1271_acx_fw_tsf_information *tsf_info;
110 diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h
111 index f090a04..7589167 100644
112 --- a/drivers/net/wireless/wl12xx/wl1271_acx.h
113 +++ b/drivers/net/wireless/wl12xx/wl1271_acx.h
114 @@ -1174,6 +1174,11 @@ int wl1271_acx_keep_alive_config(struct wl1271 *wl, u8 index, u8 tpl_valid);
115  int wl1271_acx_rssi_snr_trigger(struct wl1271 *wl, bool enable,
116                                 s16 thold, u8 hyst);
117  int wl1271_acx_rssi_snr_avg_weights(struct wl1271 *wl);
118 +int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
119 +                                   struct ieee80211_sta_ht_cap *ht_cap,
120 +                                   bool allow_ht_operation);
121 +int wl1271_acx_set_ht_information(struct wl1271 *wl,
122 +                                  u16 ht_operation_mode);
123  int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime);
124  
125  #endif /* __WL1271_ACX_H__ */
126 -- 
127 1.6.6.1