[PATCH net-next] mac80211: fix spelling errors

2014-10-29 Thread Stephen Hemminger
Use codespell to find spelling errors.

Signed-off-by: Stephen Hemminger 


--- a/net/mac80211/cfg.c2014-09-28 16:27:20.657506824 -0700
+++ b/net/mac80211/cfg.c2014-10-27 20:39:21.207560433 -0700
@@ -190,7 +190,7 @@ static int ieee80211_add_key(struct wiph
 * receive the key. When wpa_supplicant has roamed
 * using FT, it attempts to set the key before
 * association has completed, this rejects that attempt
-* so it will set the key again after assocation.
+* so it will set the key again after association.
 *
 * TODO: accept the key if we have a station entry and
 *   add it to the device after the station.
--- a/net/mac80211/chan.c   2014-09-28 16:27:20.657506824 -0700
+++ b/net/mac80211/chan.c   2014-10-27 20:39:31.959544235 -0700
@@ -1634,7 +1634,7 @@ int ieee80211_vif_change_bandwidth(struc
}
break;
case IEEE80211_CHANCTX_WILL_BE_REPLACED:
-   /* TODO: Perhaps the bandwith change could be treated as a
+   /* TODO: Perhaps the bandwidth change could be treated as a
 * reservation itself? */
ret = -EBUSY;
goto out;
--- a/net/mac80211/ieee80211_i.h2014-09-28 16:27:20.657506824 -0700
+++ b/net/mac80211/ieee80211_i.h2014-10-27 20:34:20.639799015 -0700
@@ -131,7 +131,7 @@ enum ieee80211_bss_corrupt_data_flags {
  *
  * These are bss flags that are attached to a bss in the
  * @valid_data field of &struct ieee80211_bss.  They show which parts
- * of the data structure were recieved as a result of an un-corrupted
+ * of the data structure were received as a result of an un-corrupted
  * beacon/probe response.
  */
 enum ieee80211_bss_valid_data_flags {
--- a/net/mac80211/rc80211_minstrel.c   2014-09-28 16:27:20.661506846 -0700
+++ b/net/mac80211/rc80211_minstrel.c   2014-10-27 20:39:46.503525113 -0700
@@ -191,7 +191,7 @@ minstrel_update_stats(struct minstrel_pr
 * (1) if any success probabilitiy >= 95%, out of those rates
 * choose the maximum throughput rate as max_prob_rate
 * (2) if all success probabilities < 95%, the rate with
-* highest success probability is choosen as max_prob_rate */
+* highest success probability is chosen as max_prob_rate */
if (mrs->probability >= MINSTREL_FRAC(95, 100)) {
if (mrs->cur_tp >= mi->r[tmp_prob_rate].stats.cur_tp)
tmp_prob_rate = i;
--- a/net/mac802154/ieee802154_dev.c2014-07-25 11:02:43.895028221 -0700
+++ b/net/mac802154/ieee802154_dev.c2014-10-27 20:40:26.471487715 -0700
@@ -267,7 +267,7 @@ ieee802154_alloc_device(size_t priv_data
 * +---+
 *
 * Due to ieee802154 layer isn't aware of driver and MAC structures,
-* so lets allign them here.
+* so lets align them here.
 */
 
priv_size = ALIGN(sizeof(*priv), NETDEV_ALIGN) + priv_data_len;
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] rtlwifi: Add more checks for get_btc_status callback

2014-10-29 Thread Larry Finger

On 10/29/2014 06:28 PM, Murilo Opsfelder Araujo wrote:

This is a complement of commit 08054200117a95afc14c3d2ed3a38bf4e345bf78
"rtlwifi: Add check for get_btc_status callback".

With this patch, next-20141029 at least does not panic with rtl8192se
device.



This patch is OK, but as noted it is not complete.

I have patches to fix all the kernel panics for rtl8192se AND rtl8192ce. There 
are missing parts, but I would prefer submitting mine, which would conflict with 
this one. For that reason, NACK for this one, and please apply the set I am 
submitting now.


Larry


Signed-off-by: Murilo Opsfelder Araujo 
---

Hello, everyone.

Some days ago, I reported [1] that next-20140930 introduced an issue
with rtl8192se devices.

Later on, Larry Finger proposed [2] a fix that did not solve the
problem thoroughly.

This patch is based on Larry's one [3].  It also does not solve the
rtl8192se issue completely but I can at least boot next-20141029
without a panic.

The remaining issue is that the rtl8192se device does not associate.
It does not even show any wifi network available.  The device is shown
by iwconfig, but I cannot do anything with it.

I need help from someone out there that could provide me guidance or
possibly investigate the issue (I'm not a kernel expert yet).

I'd not like to see this regression landing on v3.18.

[1] http://marc.info/?l=linux-wireless&m=141403434929612
[2] http://marc.info/?l=linux-wireless&m=141408165513255
[3] http://marc.info/?l=linux-wireless&m=141416876810127

  drivers/net/wireless/rtlwifi/base.c |  6 --
  drivers/net/wireless/rtlwifi/core.c |  9 ++---
  drivers/net/wireless/rtlwifi/pci.c  |  3 ++-
  drivers/net/wireless/rtlwifi/ps.c   | 12 
  4 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/base.c 
b/drivers/net/wireless/rtlwifi/base.c
index 40b6d1d..1a51577 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -1234,7 +1234,8 @@ EXPORT_SYMBOL_GPL(rtl_action_proc);
  static void setup_arp_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc)
  {
rtlpriv->ra.is_special_data = true;
-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_special_packet_notify(
rtlpriv, 1);
rtlpriv->enter_ps = false;
@@ -1629,7 +1630,8 @@ void rtl_watchdog_wq_callback(void *data)
}
}

-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_periodical(rtlpriv);

rtlpriv->link_info.bcn_rx_inperiod = 0;
diff --git a/drivers/net/wireless/rtlwifi/core.c 
b/drivers/net/wireless/rtlwifi/core.c
index f6179bc..686d256 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -1133,7 +1133,8 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw 
*hw,
ppsc->report_linked = (mstatus == RT_MEDIA_CONNECT) ?
  true : false;

-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_mediastatus_notify(
rtlpriv, mstatus);
}
@@ -1373,7 +1374,8 @@ static void rtl_op_sw_scan_start(struct ieee80211_hw *hw)
return;
}

-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_scan_notify(rtlpriv, 1);

if (rtlpriv->dm.supp_phymode_switch) {
@@ -1425,7 +1427,8 @@ static void rtl_op_sw_scan_complete(struct ieee80211_hw 
*hw)
}

rtlpriv->cfg->ops->scan_operation_backup(hw, SCAN_OPT_RESTORE);
-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_scan_notify(rtlpriv, 0);
  }

diff --git a/drivers/net/wireless/rtlwifi/pci.c 
b/drivers/net/wireless/rtlwifi/pci.c
index 25daa87..ed3364d 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1833,7 +1833,8 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
unsigned long flags;
u8 RFInProgressTimeOut = 0;

-   if (rtlpriv->cfg->ops->get_b

[PATCH 6/6 V3.18] rtlwifi: rtl8192se: Fix firmware loading

2014-10-29 Thread Larry Finger
An error in the code makes the allocated space for firmware to be too
small.

Signed-off-by: Larry Finger 
Cc: Murilo Opsfelder Araujo 
---
 drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c 
b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index 1fd2208..aadba29 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -209,8 +209,8 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
if (!rtlpriv->rtlhal.pfirmware)
return 1;
 
-   rtlpriv->max_fw_size = RTL8190_MAX_RAW_FIRMWARE_CODE_SIZE;
-
+   rtlpriv->max_fw_size = RTL8190_MAX_FIRMWARE_CODE_SIZE*2 +
+  sizeof(struct fw_hdr);
pr_info("Driver for Realtek RTL8192SE/RTL8191SE\n"
"Loading firmware %s\n", rtlpriv->cfg->fw_name);
/* request fw */
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/6i V3.18] rtlwifi: rtl8192se: Add missing section to read descriptor setting

2014-10-29 Thread Larry Finger
The new version of rtlwifi needs code in rtl92se_get_desc() that returns
the buffer address for read operations.

Signed-off-by: Larry Finger 
Cc: Murilo Opsfelder Araujo 
---
 drivers/net/wireless/rtlwifi/rtl8192se/def.h | 2 ++
 drivers/net/wireless/rtlwifi/rtl8192se/trx.c | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/def.h 
b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
index 83c9867..6e7a70b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
@@ -446,6 +446,8 @@
 /* DWORD 6 */
 #define SET_RX_STATUS__DESC_BUFF_ADDR(__pdesc, __val)  \
SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val)
+#define GET_RX_STATUS_DESC_BUFF_ADDR(__pdesc)  \
+   SHIFT_AND_MASK_LE(__pdesc + 24, 0, 32)
 
 #define SE_RX_HAL_IS_CCK_RATE(_pdesc)\
(GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE1M ||  \
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c 
b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index b358ebc..672fd3b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -640,6 +640,9 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
case HW_DESC_RXPKT_LEN:
ret = GET_RX_STATUS_DESC_PKT_LEN(desc);
break;
+   case HW_DESC_RXBUFF_ADDR:
+   ret = GET_RX_STATUS_DESC_BUFF_ADDR(desc);
+   break;
default:
RT_ASSERT(false, "ERR rxdesc :%d not process\n",
  desc_name);
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/6 3.18] rtlwifi: rtl8192ce: rtl8192de: rtl8192se: Fix handling for missing get_btc_status

2014-10-29 Thread Larry Finger
The recent changes in checking for Bluetooth status added some callbacks to code
in rtlwifi. To make certain that all callbacks are defined, a dummy routine has 
been
added to rtlwifi, and the drivers that need to use it are modified.

Signed-off-by: Larry Finger 
Cc: Murilo Opsfelder Araujo 
---
 drivers/net/wireless/rtlwifi/core.c | 6 ++
 drivers/net/wireless/rtlwifi/core.h | 1 +
 drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 +
 drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 1 +
 drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 1 +
 5 files changed, 10 insertions(+)

diff --git a/drivers/net/wireless/rtlwifi/core.c 
b/drivers/net/wireless/rtlwifi/core.c
index f6179bc..07dae0d 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -1828,3 +1828,9 @@ const struct ieee80211_ops rtl_ops = {
.flush = rtl_op_flush,
 };
 EXPORT_SYMBOL_GPL(rtl_ops);
+
+bool rtl_btc_status_false(void)
+{
+   return false;
+}
+EXPORT_SYMBOL_GPL(rtl_btc_status_false);
diff --git a/drivers/net/wireless/rtlwifi/core.h 
b/drivers/net/wireless/rtlwifi/core.h
index 59cd3b9..624e1dc 100644
--- a/drivers/net/wireless/rtlwifi/core.h
+++ b/drivers/net/wireless/rtlwifi/core.h
@@ -42,5 +42,6 @@ void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path 
rfpath, u32 addr,
 u32 mask, u32 data);
 void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data);
 bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb);
+bool rtl_btc_status_false(void);
 
 #endif
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c 
b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index d86b5b5..46ea076 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -244,6 +244,7 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = {
.phy_lc_calibrate = _rtl92ce_phy_lc_calibrate,
.phy_set_bw_mode_callback = rtl92ce_phy_set_bw_mode_callback,
.dm_dynamic_txpower = rtl92ce_dm_dynamic_txpower,
+   .get_btc_status = rtl_btc_status_false,
 };
 
 static struct rtl_mod_params rtl92ce_mod_params = {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c 
b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
index edab5a5..a0aba08 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
@@ -251,6 +251,7 @@ static struct rtl_hal_ops rtl8192de_hal_ops = {
.get_rfreg = rtl92d_phy_query_rf_reg,
.set_rfreg = rtl92d_phy_set_rf_reg,
.linked_set_reg = rtl92d_linked_set_reg,
+   .get_btc_status = rtl_btc_status_false,
 };
 
 static struct rtl_mod_params rtl92de_mod_params = {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c 
b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index 1bff2a0..5e16984 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -294,6 +294,7 @@ static struct rtl_hal_ops rtl8192se_hal_ops = {
.set_bbreg = rtl92s_phy_set_bb_reg,
.get_rfreg = rtl92s_phy_query_rf_reg,
.set_rfreg = rtl92s_phy_set_rf_reg,
+   .get_btc_status = rtl_btc_status_false,
 };
 
 static struct rtl_mod_params rtl92se_mod_params = {
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/6 3.18] Fixes for iwlwifi drivers

2014-10-29 Thread Larry Finger
Some late changes to rtlwifi made some of the older drivers not start correctly.
These patches should be applied to 3.18.

Signed-off-by: Larry Finger 
Cc: Murilo Opsfelder Araujo 

Larry Finger (6):
  rtlwifi: rtl8192ce: rtl8192de: rtl8192se: Fix handling for missing
get_btc_status
  rtlwifi: rtl8192se: Fix duplicate calls to ieee80211_register_hw()
  rtlwifi: rtl8192se: Add missing section to read descriptor setting
  rtlwifi: rtl8192ce: Add missing section to read descriptor setting
  rtlwifi: rtl8821ae: Remove extra semicolons
  rtlwifi: rtl8192se: Fix firmware loading

 drivers/net/wireless/rtlwifi/core.c  |  6 ++
 drivers/net/wireless/rtlwifi/core.h  |  1 +
 drivers/net/wireless/rtlwifi/rtl8192ce/def.h |  2 ++
 drivers/net/wireless/rtlwifi/rtl8192ce/sw.c  |  1 +
 drivers/net/wireless/rtlwifi/rtl8192ce/trx.c |  3 +++
 drivers/net/wireless/rtlwifi/rtl8192de/sw.c  |  1 +
 drivers/net/wireless/rtlwifi/rtl8192se/def.h |  2 ++
 drivers/net/wireless/rtlwifi/rtl8192se/sw.c  | 22 +++---
 drivers/net/wireless/rtlwifi/rtl8192se/trx.c |  3 +++
 drivers/net/wireless/rtlwifi/rtl8821ae/phy.c | 12 ++--
 10 files changed, 28 insertions(+), 25 deletions(-)

-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/6 V3.18] rtlwifi: rtl8821ae: Remove extra semicolons

2014-10-29 Thread Larry Finger
The kbuild test robot reports that there are extra semicolons in this
driver. All of them are caused by using "};" rather than "}" at the
end of a switch statement. This patch does not change any functionality.

Signed-off-by: Larry Finger 
Cc: Murilo Opsfelder Araujo 
---
 drivers/net/wireless/rtlwifi/rtl8821ae/phy.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/phy.c 
b/drivers/net/wireless/rtlwifi/rtl8821ae/phy.c
index 1e9570f..9b4d8a6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8821ae/phy.c
@@ -800,7 +800,7 @@ static void _rtl8821ae_phy_set_txpower_by_rate_base(struct 
ieee80211_hw *hw,
 "Invalid RateSection %d in Band 2.4G,Rf Path 
%d, %dTx in PHY_SetTxPowerByRateBase()\n",
 rate_section, path, txnum);
break;
-   };
+   }
} else if (band == BAND_ON_5G) {
switch (rate_section) {
case OFDM:
@@ -823,7 +823,7 @@ static void _rtl8821ae_phy_set_txpower_by_rate_base(struct 
ieee80211_hw *hw,
"Invalid RateSection %d in Band 5G, Rf Path %d, 
%dTx in PHY_SetTxPowerByRateBase()\n",
rate_section, path, txnum);
break;
-   };
+   }
} else {
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
"Invalid Band %d in PHY_SetTxPowerByRateBase()\n", 
band);
@@ -870,7 +870,7 @@ static u8 _rtl8821ae_phy_get_txpower_by_rate_base(struct 
ieee80211_hw *hw,
 "Invalid RateSection %d in Band 2.4G, Rf Path 
%d, %dTx in PHY_GetTxPowerByRateBase()\n",
 rate_section, path, txnum);
break;
-   };
+   }
} else if (band == BAND_ON_5G) {
switch (rate_section) {
case OFDM:
@@ -893,7 +893,7 @@ static u8 _rtl8821ae_phy_get_txpower_by_rate_base(struct 
ieee80211_hw *hw,
 "Invalid RateSection %d in Band 5G, Rf Path 
%d, %dTx in PHY_GetTxPowerByRateBase()\n",
 rate_section, path, txnum);
break;
-   };
+   }
} else {
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
 "Invalid Band %d in PHY_GetTxPowerByRateBase()\n", 
band);
@@ -3746,7 +3746,7 @@ static void _rtl8821ae_iqk_tx_fill_iqc(struct 
ieee80211_hw *hw,
break;
default:
break;
-   };
+   }
 }
 
 static void _rtl8821ae_iqk_rx_fill_iqc(struct ieee80211_hw *hw,
@@ -3767,7 +3767,7 @@ static void _rtl8821ae_iqk_rx_fill_iqc(struct 
ieee80211_hw *hw,
break;
default:
break;
-   };
+   }
 }
 
 #define cal_num 10
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/6i V3.18] rtlwifi: rtl8192ce: Add missing section to read descriptor setting

2014-10-29 Thread Larry Finger
The new version of rtlwifi needs code in rtl92ce_get_desc() that returns
the buffer address for read operations.

Signed-off-by: Larry Finger 
Cc: Murilo Opsfelder Araujo 
---
 drivers/net/wireless/rtlwifi/rtl8192ce/def.h | 2 ++
 drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h 
b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
index 831df10..9b660df 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
@@ -114,6 +114,8 @@
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 16, 4)
 #defineGET_C2H_CMD_FEEDBACK_CCX_SEQ(__pcmdfbhdr)   \
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 20, 12)
+#define GET_RX_STATUS_DESC_BUFF_ADDR(__pdesc)  \
+   SHIFT_AND_MASK_LE(__pdesc + 24, 0, 32)
 
 #define CHIP_VER_B BIT(4)
 #define CHIP_BONDING_IDENTIFIER(_value) (((_value) >> 22) & 0x3)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c 
b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index 2fb9c7a..dc3d20b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -728,6 +728,9 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
case HW_DESC_RXPKT_LEN:
ret = GET_RX_DESC_PKT_LEN(pdesc);
break;
+   case HW_DESC_RXBUFF_ADDR:
+   ret = GET_RX_STATUS_DESC_BUFF_ADDR(pdesc);
+   break;
default:
RT_ASSERT(false, "ERR rxdesc :%d not process\n",
  desc_name);
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6 V3.18] rtlwifi: rtl8192se: Fix duplicate calls to ieee80211_register_hw()

2014-10-29 Thread Larry Finger
Driver rtlwifi has been modified to call ieee80211_register_hw()
from the probe routine; however, the existing call in the callback
routine for deferred firmware loading was not removed.

Signed-off-by: Larry Finger 
Cc: Murilo Opsfelder Araujo 
---
 drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 17 -
 1 file changed, 17 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c 
b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index 5e16984..1fd2208 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -87,11 +87,8 @@ static void rtl92s_init_aspm_vars(struct ieee80211_hw *hw)
 static void rtl92se_fw_cb(const struct firmware *firmware, void *context)
 {
struct ieee80211_hw *hw = context;
-   struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
struct rtl_priv *rtlpriv = rtl_priv(hw);
-   struct rtl_pci *rtlpci = rtl_pcidev(pcipriv);
struct rt_firmware *pfirmware = NULL;
-   int err;
 
RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
 "Firmware callback routine entered!\n");
@@ -112,20 +109,6 @@ static void rtl92se_fw_cb(const struct firmware *firmware, 
void *context)
memcpy(pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size);
pfirmware->sz_fw_tmpbufferlen = firmware->size;
release_firmware(firmware);
-
-   err = ieee80211_register_hw(hw);
-   if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Can't register mac80211 hw\n");
-   return;
-   } else {
-   rtlpriv->mac80211.mac80211_registered = 1;
-   }
-   rtlpci->irq_alloc = 1;
-   set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status);
-
-   /*init rfkill */
-   rtl_init_rfkill(hw);
 }
 
 static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] rtlwifi: Add more checks for get_btc_status callback

2014-10-29 Thread Murilo Opsfelder Araujo
This is a complement of commit 08054200117a95afc14c3d2ed3a38bf4e345bf78
"rtlwifi: Add check for get_btc_status callback".

With this patch, next-20141029 at least does not panic with rtl8192se
device.

Signed-off-by: Murilo Opsfelder Araujo 
---

Hello, everyone.

Some days ago, I reported [1] that next-20140930 introduced an issue
with rtl8192se devices.

Later on, Larry Finger proposed [2] a fix that did not solve the
problem thoroughly.

This patch is based on Larry's one [3].  It also does not solve the
rtl8192se issue completely but I can at least boot next-20141029
without a panic.

The remaining issue is that the rtl8192se device does not associate.
It does not even show any wifi network available.  The device is shown
by iwconfig, but I cannot do anything with it.

I need help from someone out there that could provide me guidance or
possibly investigate the issue (I'm not a kernel expert yet).

I'd not like to see this regression landing on v3.18.

[1] http://marc.info/?l=linux-wireless&m=141403434929612
[2] http://marc.info/?l=linux-wireless&m=141408165513255
[3] http://marc.info/?l=linux-wireless&m=141416876810127

 drivers/net/wireless/rtlwifi/base.c |  6 --
 drivers/net/wireless/rtlwifi/core.c |  9 ++---
 drivers/net/wireless/rtlwifi/pci.c  |  3 ++-
 drivers/net/wireless/rtlwifi/ps.c   | 12 
 4 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/base.c 
b/drivers/net/wireless/rtlwifi/base.c
index 40b6d1d..1a51577 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -1234,7 +1234,8 @@ EXPORT_SYMBOL_GPL(rtl_action_proc);
 static void setup_arp_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc)
 {
rtlpriv->ra.is_special_data = true;
-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_special_packet_notify(
rtlpriv, 1);
rtlpriv->enter_ps = false;
@@ -1629,7 +1630,8 @@ void rtl_watchdog_wq_callback(void *data)
}
}

-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_periodical(rtlpriv);

rtlpriv->link_info.bcn_rx_inperiod = 0;
diff --git a/drivers/net/wireless/rtlwifi/core.c 
b/drivers/net/wireless/rtlwifi/core.c
index f6179bc..686d256 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -1133,7 +1133,8 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw 
*hw,
ppsc->report_linked = (mstatus == RT_MEDIA_CONNECT) ?
  true : false;

-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_mediastatus_notify(
rtlpriv, mstatus);
}
@@ -1373,7 +1374,8 @@ static void rtl_op_sw_scan_start(struct ieee80211_hw *hw)
return;
}

-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_scan_notify(rtlpriv, 1);

if (rtlpriv->dm.supp_phymode_switch) {
@@ -1425,7 +1427,8 @@ static void rtl_op_sw_scan_complete(struct ieee80211_hw 
*hw)
}

rtlpriv->cfg->ops->scan_operation_backup(hw, SCAN_OPT_RESTORE);
-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_scan_notify(rtlpriv, 0);
 }

diff --git a/drivers/net/wireless/rtlwifi/pci.c 
b/drivers/net/wireless/rtlwifi/pci.c
index 25daa87..ed3364d 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1833,7 +1833,8 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
unsigned long flags;
u8 RFInProgressTimeOut = 0;

-   if (rtlpriv->cfg->ops->get_btc_status())
+   if (rtlpriv->cfg->ops->get_btc_status &&
+   rtlpriv->cfg->ops->get_btc_status())
rtlpriv->btcoexist.btc_ops->btc_halt_notify();

/*
diff --git a/drivers/net/wireless/rtlwifi/ps.c 
b/drivers/net/wireless/rtlwifi/ps.c
index b69321d..2278af9 100644
--- a/drivers/net/wireless/rtlwifi/ps.c
+++ b/drivers

[PATCH 7/7] wireless-regdb: Add 160 MHz channel bandwidth for Venezuela (VE)

2014-10-29 Thread Jouni Malinen
This extends regulatory rules for Venezuela to allow 160 MHz VHT channels
to be used in 5.15-5.25 GHz, 5.25-5.35 GHz. Since the rules between
5.15-5.25 and 5.25-5.35 GHz ranges are different (e.g., DFS
requirement), the AUTO-BW flag needs to be used to allow the maximum
channel bandwidth to be determined automatically based on two rules.

Signed-off-by: Jouni Malinen 
---
 db.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/db.txt b/db.txt
index 499cc1b..c7854c2 100644
--- a/db.txt
+++ b/db.txt
@@ -1159,8 +1159,8 @@ country VC: DFS-ETSI
 # http://www.conatel.gob.ve/
 country VE: DFS-FCC
(2402 - 2482 @ 40), (30)
-   (5170 - 5250 @ 80), (23)
-   (5250 - 5330 @ 80), (23), DFS
+   (5170 - 5250 @ 80), (23), AUTO-BW
+   (5250 - 5330 @ 80), (23), DFS, AUTO-BW
(5735 - 5835 @ 80), (30)
 
 country VI: DFS-FCC
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] wireless-regdb: Add 160 MHz channel bandwidth for Panama (PA)

2014-10-29 Thread Jouni Malinen
This extends regulatory rules for Panama to allow 160 MHz VHT channels
to be used in 5.15-5.25 GHz, 5.25-5.35 GHz. Since the rules between
5.15-5.25 and 5.25-5.35 GHz ranges are different (e.g., DFS
requirement), the AUTO-BW flag needs to be used to allow the maximum
channel bandwidth to be determined automatically based on two rules.

Signed-off-by: Jouni Malinen 
---
 db.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/db.txt b/db.txt
index 0df4644..499cc1b 100644
--- a/db.txt
+++ b/db.txt
@@ -863,8 +863,8 @@ country OM: DFS-ETSI
 
 country PA: DFS-FCC
(2402 - 2472 @ 40), (30)
-   (5170 - 5250 @ 80), (17)
-   (5250 - 5330 @ 80), (23), DFS
+   (5170 - 5250 @ 80), (17), AUTO-BW
+   (5250 - 5330 @ 80), (23), DFS, AUTO-BW
(5735 - 5835 @ 80), (30)
 
 country PE: DFS-FCC
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] wireless-regdb: Add 160 MHz channel bandwidth for Dominica (DM)

2014-10-29 Thread Jouni Malinen
This extends regulatory rules for Dominica to allow 160 MHz
VHT channels to be used in 5.15-5.25 GHz, 5.25-5.35 GHz. Since the rules
between 5.15-5.25 and 5.25-5.35 GHz ranges are different (e.g., DFS
requirement), the AUTO-BW flag needs to be used to allow the maximum
channel bandwidth to be determined automatically based on two rules.

Signed-off-by: Jouni Malinen 
---
 db.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/db.txt b/db.txt
index 999bc5f..d527b54 100644
--- a/db.txt
+++ b/db.txt
@@ -331,8 +331,8 @@ country DK: DFS-ETSI
 # 
http://www.ntrcdom.org/index.php?option=com_content&view=category&layout=blog&id=10&Itemid=55
 country DM: DFS-FCC
(2402 - 2472 @ 40), (30)
-   (5170 - 5250 @ 80), (17)
-   (5250 - 5330 @ 80), (23), DFS
+   (5170 - 5250 @ 80), (17), AUTO-BW
+   (5250 - 5330 @ 80), (23), DFS, AUTO-BW
(5735 - 5835 @ 80), (30)
 
 country DO: DFS-FCC
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/7] wireless-regdb: Add 160 MHz channel bandwidth for Malaysia (MY)

2014-10-29 Thread Jouni Malinen
This extends regulatory rules for Malaysia to allow 160 MHz VHT channels
to be used in 5.15-5.25 GHz, 5.25-5.35 GHz. Since the rules between
5.15-5.25 and 5.25-5.35 GHz ranges are different (e.g., DFS
requirement), the AUTO-BW flag needs to be used to allow the maximum
channel bandwidth to be determined automatically based on two rules.

Signed-off-by: Jouni Malinen 
---
 db.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/db.txt b/db.txt
index 10aaf44..0df4644 100644
--- a/db.txt
+++ b/db.txt
@@ -801,8 +801,8 @@ country MW: DFS-ETSI
 
 country MY: DFS-FCC
(2402 - 2482 @ 40), (20)
-   (5170 - 5250 @ 80), (17)
-   (5250 - 5330 @ 80), (23), DFS
+   (5170 - 5250 @ 80), (17), AUTO-BW
+   (5250 - 5330 @ 80), (23), DFS, AUTO-BW
(5735 - 5835 @ 80), (30)
 
 country MX: DFS-FCC
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] wireless-regdb: Add 160 MHz channel bandwidth for Barbados (BB)

2014-10-29 Thread Jouni Malinen
This extends regulatory rules for Barbados to allow 160 MHz VHT channels
to be used in 5.15-5.25 GHz, 5.25-5.35 GHz. Since the rules between
5.15-5.25 and 5.25-5.35 GHz ranges are different (e.g., DFS
requirement), the AUTO-BW flag needs to be used to allow the maximum
channel bandwidth to be determined automatically based on two rules.

Signed-off-by: Jouni Malinen 
---
 db.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/db.txt b/db.txt
index 2a54da8..8d43f45 100644
--- a/db.txt
+++ b/db.txt
@@ -113,8 +113,8 @@ country BA: DFS-ETSI
 
 country BB: DFS-FCC
(2402 - 2482 @ 40), (20)
-   (5170 - 5250 @ 80), (23)
-   (5250 - 5330 @ 80), (23), DFS
+   (5170 - 5250 @ 80), (23), AUTO-BW
+   (5250 - 5330 @ 80), (23), DFS, AUTO-BW
(5735 - 5835 @ 80), (30)
 
 country BD: DFS-JP
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] wireless-regdb: Add 160 MHz channel bandwidth for Algeria (DZ)

2014-10-29 Thread Jouni Malinen
This extends regulatory rules for Algeria to allow 160 MHz VHT channels
to be used in 5.15-5.25 GHz, 5.25-5.35 GHz, and 5.47-5.725 GHz ranges.
Since the rules between 5.15-5.25 and 5.25-5.35 GHz ranges are different
in most cases (e.g., DFS requirement), the AUTO-BW flag needs to be used
to allow the maximum channel bandwidth to be determined automatically
based on two rules. The larger 5.47-5.725 GHz range is large enough to
fit the full 160 MHz channel in a single rule, so that does not require
similar handling and can just change the maximum allowed bandwidth to
160 MHz in the rule.

Signed-off-by: Jouni Malinen 
---
 db.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/db.txt b/db.txt
index d527b54..10aaf44 100644
--- a/db.txt
+++ b/db.txt
@@ -343,9 +343,9 @@ country DO: DFS-FCC
 
 country DZ: DFS-JP
(2402 - 2482 @ 40), (20)
-   (5170.000 - 5250.000 @ 80.000), (23.00)
-   (5250.000 - 5330.000 @ 80.000), (23.00), DFS
-   (5490.000 - 5670.000 @ 80.000), (23.00), DFS
+   (5170.000 - 5250.000 @ 80.000), (23.00), AUTO-BW
+   (5250.000 - 5330.000 @ 80.000), (23.00), DFS, AUTO-BW
+   (5490.000 - 5670.000 @ 160.000), (23.00), DFS
 
 country EC: DFS-FCC
(2402 - 2482 @ 40), (20)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/7] wireless-regdb: Add 160 MHz channel bandwidth for Dominican Republic (DO)

2014-10-29 Thread Jouni Malinen
This extends regulatory rules for Dominican Republic to allow 160 MHz
VHT channels to be used in 5.15-5.25 GHz, 5.25-5.35 GHz. Since the rules
between 5.15-5.25 and 5.25-5.35 GHz ranges are different (e.g., DFS
requirement), the AUTO-BW flag needs to be used to allow the maximum
channel bandwidth to be determined automatically based on two rules.

Signed-off-by: Jouni Malinen 
---
 db.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/db.txt b/db.txt
index 8d43f45..999bc5f 100644
--- a/db.txt
+++ b/db.txt
@@ -337,8 +337,8 @@ country DM: DFS-FCC
 
 country DO: DFS-FCC
(2402 - 2472 @ 40), (30)
-   (5170 - 5250 @ 80), (17)
-   (5250 - 5330 @ 80), (23), DFS
+   (5170 - 5250 @ 80), (17), AUTO-BW
+   (5250 - 5330 @ 80), (23), DFS, AUTO-BW
(5735 - 5835 @ 80), (30)
 
 country DZ: DFS-JP
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 00/48] staging: vt6655: remove dead code.

2014-10-29 Thread Greg KH
On Wed, Oct 29, 2014 at 05:55:18PM +, Malcolm Priestley wrote:
> Following conversion to mac80211 the following patches remove dead code.
> 
> Changes from v1 corrected the order patches and rebased on staging-testing.

All now applied, thanks.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: strange MPDU loss pattern

2014-10-29 Thread Adrian Chadd
Just finally -

MCS20 -> MCS23 are very sensitive to changing channel anything. See if
you can find or make some required SNR curves for each MCS rate.

So although it doesn't surprise me to find this is happening, it's
very cute that someone's gone and done the work of figuring out how to
improve the rate control algorithm to take it into account. I'm kinda
thinking about how to do that with FreeBSD right now.

Do you get the same pattern on say, MCS0->MCS4 over a 4ms long aggregate frame?


-adrian

On 25 October 2014 13:35, Ali Abedi  wrote:
> Thank you for sharing the story.
> Even if I consider interference as a possibility, still I can't justify the
> higher
> chance of frame loss in the second half of the aggregate frame.
>
> We use
>
> PCI-express 3 antenna dual band cards
> product: AR93xx Wireless Network Adapter
> and/or
> Atheors AR5B97 which is a 2.4 GHz dual antenna internal card in a laptop
>
> we also tried TP-LINK TL-WDN4200 N900 as the receiver.
>
> However we see the same results.
> we mostly use MCS 20-23, sgi = 0, 20 MHz channels.
>
> The loss pattern is something like this
> (each line is an imaginary aggregated frame and each bit is the fate of the
> MPDU)
>
> 00011
> 11100011010110100
> 1
> 111010100
> 110010101
>
> The interesting part is that with the start of the next frame error rate
> goes down initially
> then it goes up again in the second portion of the packet.
>
> Best,
> Ali
>
>
>
>
>
> On 25/10/2014 2:30 PM, Adrian Chadd wrote:
>
> On 25 October 2014 08:28, Ali Abedi  wrote:
>
> Hi Adrian,
>
> We have a high end spectrum analyzer. So we are sure there is no background
> interference
> We run our experiments in the 5 GHZ spectrum. The channel conditions can
> still vary due to
> the movement of the people in the vicinity of the experiment setup. We
> select a rate that
> experiences at least 20% error on average. Since if the error is 100% or 0%
> it's not interesting
> for us.
>
> My point is if the channel conditions change the distribution of failed
> packets should be uniform.
> The first and second  half of the packets have the same chance to be
> received successfully.
>
> Here's a little story.
>
> My first wifi contract had me spend months trying to figure out why an
> AP was losing its mind. It'd get stuck in a "stuck beacon" loop and
> only a hard powercycle of /all/ of the access points in an area would
> clear it.
>
> It turned out that the PCB design had some non-grounded /
> non-populated tracks that just "happened" to form a 2GHz resonator.
> Once we grounded those tracks, the APs started behaving themselves.
>
> The company in question spent months with high end spectrum analysis
> kit in the lab (where it never happened) and underground (where it did
> happen.) It's only after they stuck the spectrum analyser probe
> _inside the access point_ right up close to the NIC did they see it.
>
> Here's the spectrum analyser traces. You can see the peak.
>
> http://www.creative.net.au/ath/
>
> So, weirder crap has happened.
>
> Which NICs and which MCS rates are you using?
>
>
>
> -adrian
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 00/34] staging: vt6655: Conversion to mac80211

2014-10-29 Thread Greg KH
On Wed, Oct 29, 2014 at 05:43:35PM +, Malcolm Priestley wrote:
> The patches in this series convert the driver to mac80211.
> 
> As well as infrastructure mode the driver now operates in
> IBSS and access point modes.
> 
> Host access point is now working with hostapd in nl80211 mode.
> 
> The driver continues to operate diversity mode in infrastructure mode.
> 
> There is still a lot of work that needs doing particularly remodeling
> rxtx to something similar to vt6656 driver.
> 
> These patches creates huge amount of dead code that will be
> removed in the next series.
> 
> Changes from v1 3 additional patches fixing tsf and rssi issues
> 
> Rebased on staging-testing.

All now applied, very nice work.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch] ath9k: fix some debugfs output

2014-10-29 Thread Dan Carpenter
On Wed, Oct 29, 2014 at 09:13:24AM -0700, Joe Perches wrote:
> On Wed, 2014-10-29 at 19:10 +0300, Dan Carpenter wrote:
> > On Wed, Oct 29, 2014 at 09:08:39AM -0700, Joe Perches wrote:
> > > On Wed, 2014-10-29 at 18:48 +0300, Dan Carpenter wrote:
> > > > The right shift operation has higher precedence than the mask so we
> > > > left shift by "(i * 3)" and then immediately right shift by "(i * 3)"
> > > > then we mask.  It should be left shift, mask, and then right shift.
> []
> > > My grep pattern doesn't like operations on the thing masked.
> > > Did you find this by some tool or visual inspection via grep?
> []
> > I wrote a Smatch check inspired by the i40e bug you found earlier.
> 
> Nice.  fyi: I sent a bunch of these already.
> 
> https://lkml.org/lkml/2014/10/27/38
>

Ah...  Your grep found a bunch of stuff that I missed because it wasn't
in my allmodconfig.

regards,
dan carpenter 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 30/48] staging: vt6655: move all RATE_* macros to device.h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h  | 15 +++
 drivers/staging/vt6655/vntwifi.h | 14 --
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index a5e5a007..b96d832 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -80,6 +80,21 @@
 
 /*-  Export Definitions -*/
 
+#define RATE_1M0
+#define RATE_2M1
+#define RATE_5M2
+#define RATE_11M   3
+#define RATE_6M4
+#define RATE_9M5
+#define RATE_12M   6
+#define RATE_18M   7
+#define RATE_24M   8
+#define RATE_36M   9
+#define RATE_48M   10
+#define RATE_54M   11
+#define RATE_AUTO  12
+#define MAX_RATE   12
+
 #define MAC_MAX_CONTEXT_REG (256+128)
 
 #define MAX_MULTICAST_ADDRESS_NUM   32
diff --git a/drivers/staging/vt6655/vntwifi.h b/drivers/staging/vt6655/vntwifi.h
index ad180e0..2ba7713 100644
--- a/drivers/staging/vt6655/vntwifi.h
+++ b/drivers/staging/vt6655/vntwifi.h
@@ -35,20 +35,6 @@
 #include "card.h"
 
 /*-  Export Definitions -*/
-#define RATE_1M 0
-#define RATE_2M 1
-#define RATE_5M 2
-#define RATE_11M3
-#define RATE_6M 4
-#define RATE_9M 5
-#define RATE_12M6
-#define RATE_18M7
-#define RATE_24M8
-#define RATE_36M9
-#define RATE_48M   10
-#define RATE_54M   11
-#define RATE_AUTO  12
-#define MAX_RATE   12
 
 // key CipherSuite
 #define KEY_CTL_WEP 0x00
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 06/48] staging: vt6655: dead code remove legacy hostap.c/h

2014-10-29 Thread Malcolm Priestley
hoatap is now supported by mac80211 in nl80211 mode

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |   1 -
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/dpc.c |   1 -
 drivers/staging/vt6655/hostap.c  | 764 ---
 drivers/staging/vt6655/hostap.h  |  58 ---
 drivers/staging/vt6655/rxtx.c|   1 -
 6 files changed, 826 deletions(-)
 delete mode 100644 drivers/staging/vt6655/hostap.c
 delete mode 100644 drivers/staging/vt6655/hostap.h

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 6e93499..2d53450 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -21,7 +21,6 @@ vt6655_stage-y += device_main.o \
rc4.o \
tether.o \
tcrc.o \
-   hostap.o \
wpa.o \
key.o \
tkip.o \
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 5b54cab..3a90401 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -68,7 +68,6 @@
 #include "rxtx.h"
 #include "wroute.h"
 #include "bssdb.h"
-#include "hostap.h"
 #include "wpactl.h"
 #include "dpc.h"
 #include "datarate.h"
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index 11153ef..6842baf 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -50,7 +50,6 @@
 #include "tcrc.h"
 #include "wctl.h"
 #include "wroute.h"
-#include "hostap.h"
 #include "rf.h"
 #include "iowpa.h"
 #include "aes_ccmp.h"
diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
deleted file mode 100644
index 2db08df..000
--- a/drivers/staging/vt6655/hostap.c
+++ /dev/null
@@ -1,764 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: hostap.c
- *
- * Purpose: handle hostap deamon ioctl input/out functions
- *
- * Author: Lyndon Chen
- *
- * Date: Oct. 20, 2003
- *
- * Functions:
- *
- * Revision History:
- *
- */
-
-#include "hostap.h"
-#include "iocmd.h"
-#include "mac.h"
-#include "card.h"
-#include "baseband.h"
-#include "wpactl.h"
-#include "key.h"
-
-#define VIAWGET_HOSTAPD_MAX_BUF_SIZE 1024
-#define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT0
-#define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
-#define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Functions  --*/
-
-/*-  Export Variables  --*/
-
-/*
- * Description:
- *  register net_device (AP) for hostap deamon
- *
- * Parameters:
- *  In:
- *  pDevice -
- *  rtnl_locked -
- *  Out:
- *
- * Return Value:
- *
- */
-
-static int hostap_enable_hostapd(struct vnt_private *pDevice, int rtnl_locked)
-{
-   struct vnt_private *apdev_priv;
-   struct net_device *dev = pDevice->dev;
-   int ret;
-   const struct net_device_ops apdev_netdev_ops = {
-   .ndo_start_xmit = pDevice->tx_80211,
-   };
-
-   pr_debug("%s: Enabling hostapd mode\n", dev->name);
-
-   pDevice->apdev = alloc_etherdev(sizeof(*apdev_priv));
-   if (pDevice->apdev == NULL)
-   return -ENOMEM;
-
-   apdev_priv = netdev_priv(pDevice->apdev);
-   *apdev_priv = *pDevice;
-   eth_hw_addr_inherit(pDevice->apdev, dev);
-
-   pDevice->apdev->netdev_ops = &apdev_netdev_ops;
-
-   pDevice->apdev->type = ARPHRD_IEEE80211;
-
-   pDevice->apdev->base_addr = dev->base_addr;
-   pDevice->apdev->irq = dev->irq;
-   pDevice->apdev->mem_start = dev->mem_start;
-   pDevice->apdev->mem_end = dev->mem_end;
-   sprintf(pDevice->apdev->name, "%sap", dev->name);
-   if (rtnl_locked)
-   ret = register_netdevice(pDevice->apdev);
-   else
-   ret = register_netdev(pDevice->apdev);
-   if (ret) {
-   pr_debug("%s: register_netdevice(AP) failed!\n",
-dev->name);
-   free_netdev(pDevice->apdev);
-   pDevice->apdev =

[PATCH v2 12/48] staging: vt6655: rxtx remove dead functions

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/IEEE11h.c |2 -
 drivers/staging/vt6655/rxtx.c| 1185 --
 drivers/staging/vt6655/rxtx.h|   34 --
 drivers/staging/vt6655/wroute.c  |   12 +-
 4 files changed, 1 insertion(+), 1232 deletions(-)

diff --git a/drivers/staging/vt6655/IEEE11h.c b/drivers/staging/vt6655/IEEE11h.c
index 180a27c..65eb482 100644
--- a/drivers/staging/vt6655/IEEE11h.c
+++ b/drivers/staging/vt6655/IEEE11h.c
@@ -135,7 +135,5 @@ bool IEEE11hbMSRRepTx(void *pMgmtHandle)
 
pTxPacket->cbMPDULen = uLength;
pTxPacket->cbPayloadLen = uLength - WLAN_HDR_ADDR3_LEN;
-   if (csMgmt_xmit(pMgmt->pAdapter, pTxPacket) != CMD_STATUS_PENDING)
-   return false;
return true;
 }
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index aa7e454..5c460ad 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -104,19 +104,6 @@ static const unsigned short wFB_Opt1[2][5] = {
 #define DATADUR_A_F113
 
 /*-  Static Functions  --*/
-
-static
-void
-s_vFillTxKey(
-   struct vnt_private *pDevice,
-   unsigned char *pbyBuf,
-   unsigned char *pbyIVHead,
-   PSKeyItem  pTransmitKey,
-   unsigned char *pbyHdrBuf,
-   unsigned short wPayloadLen,
-   unsigned char *pMICHDR
-);
-
 static
 void
 s_vFillRTSHead(
@@ -174,160 +161,6 @@ s_uFillDataHead(
 
 /*-  Export Variables  --*/
 
-static
-void
-s_vFillTxKey(
-   struct vnt_private *pDevice,
-   unsigned char *pbyBuf,
-   unsigned char *pbyIVHead,
-   PSKeyItem  pTransmitKey,
-   unsigned char *pbyHdrBuf,
-   unsigned short wPayloadLen,
-   unsigned char *pMICHDR
-)
-{
-   struct vnt_mic_hdr *mic_hdr = (struct vnt_mic_hdr *)pMICHDR;
-   unsigned long *pdwIV = (unsigned long *)pbyIVHead;
-   unsigned long *pdwExtIV = (unsigned long *)((unsigned char 
*)pbyIVHead+4);
-   PS802_11Header  pMACHeader = (PS802_11Header)pbyHdrBuf;
-   unsigned long dwRevIVCounter;
-   unsigned char byKeyIndex = 0;
-
-   //Fill TXKEY
-   if (pTransmitKey == NULL)
-   return;
-
-   dwRevIVCounter = cpu_to_le32(pDevice->dwIVCounter);
-   *pdwIV = pDevice->dwIVCounter;
-   byKeyIndex = pTransmitKey->dwKeyIndex & 0xf;
-
-   if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) {
-   if (pTransmitKey->uKeyLength == WLAN_WEP232_KEYLEN) {
-   memcpy(pDevice->abyPRNG, (unsigned char 
*)&(dwRevIVCounter), 3);
-   memcpy(pDevice->abyPRNG+3, pTransmitKey->abyKey, 
pTransmitKey->uKeyLength);
-   } else {
-   memcpy(pbyBuf, (unsigned char *)&(dwRevIVCounter), 3);
-   memcpy(pbyBuf+3, pTransmitKey->abyKey, 
pTransmitKey->uKeyLength);
-   if (pTransmitKey->uKeyLength == WLAN_WEP40_KEYLEN) {
-   memcpy(pbyBuf+8, (unsigned char 
*)&(dwRevIVCounter), 3);
-   memcpy(pbyBuf+11, pTransmitKey->abyKey, 
pTransmitKey->uKeyLength);
-   }
-   memcpy(pDevice->abyPRNG, pbyBuf, 16);
-   }
-   // Append IV after Mac Header
-   *pdwIV &= WEP_IV_MASK;//   
-   *pdwIV |= (unsigned long)byKeyIndex << 30;
-   *pdwIV = cpu_to_le32(*pdwIV);
-   pDevice->dwIVCounter++;
-   if (pDevice->dwIVCounter > WEP_IV_MASK)
-   pDevice->dwIVCounter = 0;
-
-   } else if (pTransmitKey->byCipherSuite == KEY_CTL_TKIP) {
-   pTransmitKey->wTSC15_0++;
-   if (pTransmitKey->wTSC15_0 == 0)
-   pTransmitKey->dwTSC47_16++;
-
-   TKIPvMixKey(pTransmitKey->abyKey, pDevice->abyCurrentNetAddr,
-   pTransmitKey->wTSC15_0, pTransmitKey->dwTSC47_16, 
pDevice->abyPRNG);
-   memcpy(pbyBuf, pDevice->abyPRNG, 16);
-   // Make IV
-   memcpy(pdwIV, pDevice->abyPRNG, 3);
-
-   *(pbyIVHead+3) = (unsigned char)(((byKeyIndex << 6) & 0xc0) | 
0x20); // 0x20 is ExtIV
-   // Append IV&ExtIV after Mac Header
-   *pdwExtIV = cpu_to_le32(pTransmitKey->dwTSC47_16);
-   pr_debug("vFillTxKey() pdwExtIV: %lx\n", *pdwExtIV);
-
-   } else if (pTransmitKey->byCipherSuite == KEY_CTL_CCMP) {
-   pTransmitKey->wTSC15_0++;
-   if (pTransmitKey->wTSC15_0 == 0)
-   pTransmitKey->dwTSC47_16++;
-
-   memcpy(pbyBuf, pTransmitKey->abyKey, 16);
-
-   // Make IV
-   *pdwIV = 0;
-   *(pbyIVHead+3) = (unsigned char)(((byKeyIndex << 6) & 0xc0) | 
0x20); // 0x20 is ExtIV
-   *pdwIV |= cpu_to_le16((unsigned short)(pTransmitKey->wTSC1

[PATCH v2 31/48] staging: vt6655: dead code remove vntwifi.h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h  |  1 -
 drivers/staging/vt6655/device_main.c |  2 -
 drivers/staging/vt6655/vntwifi.h | 90 
 drivers/staging/vt6655/wmgr.h|  5 --
 4 files changed, 98 deletions(-)
 delete mode 100644 drivers/staging/vt6655/vntwifi.h

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index b96d832..5e48608 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -507,7 +507,6 @@ struct vnt_private {
bool bEnablePSMode;
unsigned short wListenInterval;
bool bPWBitOn;
-   WMAC_POWER_MODE ePSMode;
 
/* GPIO Radio Control */
unsigned char byRadioCtl;
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index d1e..d8fd44c 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -344,7 +344,6 @@ device_set_options(struct vnt_private *pDevice)
pDevice->wMaxTransmitMSDULifetime = DEFAULT_MSDU_LIFETIME;
pDevice->byShortPreamble = (pDevice->sOpts.flags & 
DEVICE_FLAGS_PREAMBLE_TYPE) ? 1 : 0;
pDevice->byOpMode = (pDevice->sOpts.flags & DEVICE_FLAGS_OP_MODE) ? 1 : 
0;
-   pDevice->ePSMode = (pDevice->sOpts.flags & DEVICE_FLAGS_PS_MODE) ? 1 : 
0;
pDevice->b11hEnable = (pDevice->sOpts.flags & DEVICE_FLAGS_80211h_MODE) 
? 1 : 0;
pDevice->bDiversityRegCtlON = (pDevice->sOpts.flags & 
DEVICE_FLAGS_DiversityANT) ? 1 : 0;
pDevice->uConnectionRate = pDevice->sOpts.data_rate;
@@ -359,7 +358,6 @@ device_set_options(struct vnt_private *pDevice)
 
pr_debug(" uChannel= %d\n", (int)pDevice->uChannel);
pr_debug(" byOpMode= %d\n", (int)pDevice->byOpMode);
-   pr_debug(" ePSMode= %d\n", (int)pDevice->ePSMode);
pr_debug(" wRTSThreshold= %d\n", (int)pDevice->wRTSThreshold);
pr_debug(" byShortRetryLimit= %d\n", (int)pDevice->byShortRetryLimit);
pr_debug(" byLongRetryLimit= %d\n", (int)pDevice->byLongRetryLimit);
diff --git a/drivers/staging/vt6655/vntwifi.h b/drivers/staging/vt6655/vntwifi.h
deleted file mode 100644
index 2ba7713..000
--- a/drivers/staging/vt6655/vntwifi.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: vntwifi.h
- *
- * Purpose: export VNT Host WiFi library function
- *
- * Author: Yiching Chen
- *
- * Date: Jan 7, 2004
- *
- */
-
-#ifndef __VNTWIFI_H__
-#define __VNTWIFI_H__
-
-#include "ttype.h"
-#include "80211mgr.h"
-#include "card.h"
-
-/*-  Export Definitions -*/
-
-// key CipherSuite
-#define KEY_CTL_WEP 0x00
-#define KEY_CTL_NONE0x01
-#define KEY_CTL_TKIP0x02
-#define KEY_CTL_CCMP0x03
-#define KEY_CTL_INVALID 0xFF
-
-#define CHANNEL_MAX_24G 14
-
-#define MAX_BSS_NUM 42
-
-// Pre-configured Authenticaiton Mode (from XP)
-typedef enum tagWMAC_AUTHENTICATION_MODE {
-   WMAC_AUTH_OPEN,
-   WMAC_AUTH_SHAREKEY,
-   WMAC_AUTH_AUTO,
-   WMAC_AUTH_WPA,
-   WMAC_AUTH_WPAPSK,
-   WMAC_AUTH_WPANONE,
-   WMAC_AUTH_WPA2,
-   WMAC_AUTH_WPA2PSK,
-   WMAC_AUTH_MAX   // Not a real mode, defined as upper bound
-} WMAC_AUTHENTICATION_MODE, *PWMAC_AUTHENTICATION_MODE;
-
-typedef enum tagWMAC_ENCRYPTION_MODE {
-   WMAC_ENCRYPTION_WEPEnabled,
-   WMAC_ENCRYPTION_WEPDisabled,
-   WMAC_ENCRYPTION_WEPKeyAbsent,
-   WMAC_ENCRYPTION_WEPNotSupported,
-   WMAC_ENCRYPTION_TKIPEnabled,
-   WMAC_ENCRYPTION_TKIPKeyAbsent,
-   WMAC_ENCRYPTION_AESEnabled,
-   WMAC_ENCRYPTION_AESKeyAbsent
-} WMAC_ENCRYPTION_MODE, *PWMAC_ENCRYPTION_MODE;
-
-// Pre-configured Mode (from XP)
-
-typedef enum tagWMAC_CONFIG_MODE {
-   WMAC_CONFIG_ESS_STA = 0,
-   WMAC_CONFIG_IBSS_STA,
-   WMAC_CONFIG_AUTO,
-   WMAC_CONFIG_AP
-} WMAC_CONFIG_MODE, *PWMAC_CONFIG_MODE;
-
-typedef enum tagWMAC_POWER_MODE {
-   WMAC_POWER_CAM,
-   WMAC_POWER_FAST,
-   WMAC_POWER_MAX
-} WMAC_POWER_MODE, *PWMAC_POWER_MODE;
-
-
-#endif //__VNTWIFI_H__
diff --git a/drivers/staging/vt6655/wmgr.h b/driv

[PATCH v2 00/48] staging: vt6655: remove dead code.

2014-10-29 Thread Malcolm Priestley
Following conversion to mac80211 the following patches remove dead code.

Changes from v1 corrected the order patches and rebased on staging-testing.

Malcolm Priestley (48):
  staging: vt6655: deadcode remove zone file operations and
vntconfiguration.dat
  staging: vt6655: dead code remove zones and channel table elements
  staging: vt6655: dead code remove net device code
  staging: vt6655: dead code remove iwctl.c/h
  staging: vt6655: dead code remove ioctl.c/h
  staging: vt6655: dead code remove legacy hostap.c/h
  staging: vt6655: dead code remove wpactl.c/h
  staging: vt6655: dpc.c/h remove dead functions
  staging: vt6655: remove dead functions in power.c/h
  staging: vt6655: dead code remove wmgr.c
  staging: vt6655: dead code remove wcmd.c
  staging: vt6655: rxtx remove dead functions
  staging: vt6655: s_cbFillTxBufHead remove unused parameters
  staging: vt6655: dead code remove bssdb.c
  staging: vt6655: dead code datarate.c/h
  staging: vt6655: dead code remove IEEE11.h.c/h
  staging: vt6655: card.c/h remove dead functions
  staging: vt6655: deadcode remove wroute.c/h
  staging: vt6655: dead code remove wpa/wpa2
  staging: vt6655: deadcode remove aes_ccmp/rc4/tkip
  staging: vt6655: dead code remove michael.c/h
  staging: vt6655: dead code remove vntwifi.c functions
  staging: vt6655: key.c remove dead functions
  staging: vt6655: mib remove unused functions and structure members
  staging: vt6655L remove tether.c functions
  staging: vt6655: dead code remove tcrc.c/h
  staging: vt6655: dead code remove 80211mgr.c and functions
  staging: vt6655: dead code remove wctl.c/h
  staging: vt6655: channel.c remove dead functions
  staging: vt6655: move all RATE_* macros to device.h
  staging: vt6655: dead code remove vntwifi.h
  staging: vt6655: wmgr.h remove management structures
  staging: vt6655: dead code remove ndis and pmkid strutures.
  staging: vt6655: dead remove wcmd.h and typedefs
  staging: vt6655: dead code remove bssdb.h header
  staging: vt6655: dead code remove tether.h
  staging: vt6655: dead code remove 80211mgr.h
  staging: vt6655: dead code remove iowpa.h
  staging: vt6655: dead code remove iocmd.h
  staging: vt6655: dead code remove country.h
  staging: vt6655: struct vnt_private remove dead members
  staging: vt6655: device.h remove dead strutures and macros
  staging: vt6655: dead code remove 80211hdr.h
  staging: vt6655: remove typedef void *TimerFunction
  staging: vt6655: Move LIFETIME RES 64us macros to rxtx.h
  staging: vt6655: move MAKE_BEACON_RESERVED to device.h
  staging: vt6655: dead code remove wmgr.h
  staging: vt6655: dead code remove header type.h

 drivers/staging/vt6655/80211hdr.h   |  318 --
 drivers/staging/vt6655/80211mgr.c   | 1019 --
 drivers/staging/vt6655/80211mgr.h   |  725 -
 drivers/staging/vt6655/IEEE11h.c|  141 -
 drivers/staging/vt6655/IEEE11h.h|   42 -
 drivers/staging/vt6655/Makefile |   23 +-
 drivers/staging/vt6655/aes_ccmp.c   |  374 ---
 drivers/staging/vt6655/aes_ccmp.h   |   37 -
 drivers/staging/vt6655/baseband.c   |9 +-
 drivers/staging/vt6655/baseband.h   |6 +-
 drivers/staging/vt6655/bssdb.c  | 1512 -
 drivers/staging/vt6655/bssdb.h  |  325 --
 drivers/staging/vt6655/card.c   |  724 -
 drivers/staging/vt6655/card.h   |   76 -
 drivers/staging/vt6655/channel.c|  715 -
 drivers/staging/vt6655/channel.h|   22 -
 drivers/staging/vt6655/country.h|  161 -
 drivers/staging/vt6655/datarate.c   |  410 ---
 drivers/staging/vt6655/datarate.h   |   78 -
 drivers/staging/vt6655/desc.h   |2 -
 drivers/staging/vt6655/device.h |  298 +-
 drivers/staging/vt6655/device_cfg.h |2 -
 drivers/staging/vt6655/device_main.c| 1311 +---
 drivers/staging/vt6655/dpc.c| 1287 
 drivers/staging/vt6655/dpc.h|8 -
 drivers/staging/vt6655/hostap.c |  764 -
 drivers/staging/vt6655/hostap.h |   58 -
 drivers/staging/vt6655/iocmd.h  |  386 ---
 drivers/staging/vt6655/ioctl.c  |  582 
 drivers/staging/vt6655/ioctl.h  |   36 -
 drivers/staging/vt6655/iowpa.h  |  130 -
 drivers/staging/vt6655/iwctl.c  | 1858 ---
 drivers/staging/vt6655/iwctl.h  |  206 --
 drivers/staging/vt6655/key.c|  760 -
 drivers/staging/vt6655/key.h|  124 -
 drivers/staging/vt6655/mac.c|1 -
 drivers/staging/vt6655/mac.h|1 -
 drivers/staging/vt6655/mib.c|  423 ---
 drivers/staging/vt6655/mib.h|  261 --
 drivers/staging/vt6655/michael.c|  148 -
 drivers/staging/vt6655/michael.h|   52 -
 drivers/staging/vt6655/power.c  |  174 -
 drivers/stag

[PATCH v2 23/48] staging: vt6655: key.c remove dead functions

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h |   1 -
 drivers/staging/vt6655/key.c| 760 
 drivers/staging/vt6655/key.h| 120 ---
 3 files changed, 881 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 4bea237..a5e5a007 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -539,7 +539,6 @@ struct vnt_private {
bool bTransmitKey;
NDIS_802_11_WEP_STATUS  eOldEncryptionStatus;
 
-   SKeyManagement  sKey;
unsigned long dwIVCounter;
 
u64 qwPacketNumber; /* For CCMP and TKIP as TSC(6 bytes) */
diff --git a/drivers/staging/vt6655/key.c b/drivers/staging/vt6655/key.c
index b2fa812..f2b3fea 100644
--- a/drivers/staging/vt6655/key.c
+++ b/drivers/staging/vt6655/key.c
@@ -25,772 +25,12 @@
  *
  * Date: May 29, 2003
  *
- * Functions:
- *  KeyvInitTable - Init Key management table
- *  KeybGetKey - Get Key from table
- *  KeybSetKey - Set Key to table
- *  KeybRemoveKey - Remove Key from table
- *  KeybGetTransmitKey - Get Transmit Key from table
- *
- * Revision History:
- *
  */
 
 #include "tmacro.h"
 #include "key.h"
 #include "mac.h"
 
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Functions  --*/
-
-/*-  Export Variables  --*/
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Variables  --*/
-
-/*-  Static Functions  --*/
-static void
-s_vCheckKeyTableValid(PSKeyManagement pTable, void __iomem *dwIoBase)
-{
-   int i;
-
-   for (i = 0; i < MAX_KEY_TABLE; i++) {
-   if (pTable->KeyTable[i].bInUse &&
-   !pTable->KeyTable[i].PairwiseKey.bKeyValid &&
-   !pTable->KeyTable[i].GroupKey[0].bKeyValid &&
-   !pTable->KeyTable[i].GroupKey[1].bKeyValid &&
-   !pTable->KeyTable[i].GroupKey[2].bKeyValid &&
-   !pTable->KeyTable[i].GroupKey[3].bKeyValid) {
-   pTable->KeyTable[i].bInUse = false;
-   pTable->KeyTable[i].wKeyCtl = 0;
-   pTable->KeyTable[i].bSoftWEP = false;
-   MACvDisableKeyEntry(dwIoBase, i);
-   }
-   }
-}
-
-/*-  Export Functions  --*/
-
-/*
- * Description: Init Key management table
- *
- * Parameters:
- *  In:
- *  pTable  - Pointer to Key table
- *  Out:
- *  none
- *
- * Return Value: none
- *
- */
-void KeyvInitTable(PSKeyManagement pTable, void __iomem *dwIoBase)
-{
-   int i;
-   int jj;
-
-   for (i = 0; i < MAX_KEY_TABLE; i++) {
-   pTable->KeyTable[i].bInUse = false;
-   pTable->KeyTable[i].PairwiseKey.bKeyValid = false;
-   pTable->KeyTable[i].PairwiseKey.pvKeyTable = (void 
*)&pTable->KeyTable[i];
-   for (jj = 0; jj < MAX_GROUP_KEY; jj++) {
-   pTable->KeyTable[i].GroupKey[jj].bKeyValid = false;
-   pTable->KeyTable[i].GroupKey[jj].pvKeyTable = (void 
*)&pTable->KeyTable[i];
-   }
-   pTable->KeyTable[i].wKeyCtl = 0;
-   pTable->KeyTable[i].dwGTKeyIndex = 0;
-   pTable->KeyTable[i].bSoftWEP = false;
-   MACvDisableKeyEntry(dwIoBase, i);
-   }
-}
-
-/*
- * Description: Get Key from table
- *
- * Parameters:
- *  In:
- *  pTable  - Pointer to Key table
- *  pbyBSSID- BSSID of Key
- *  dwKeyIndex  - Key Index (0x means pairwise key)
- *  Out:
- *  pKey- Key return
- *
- * Return Value: true if found otherwise false
- *
- */
-bool KeybGetKey(
-   PSKeyManagement pTable,
-   unsigned char *pbyBSSID,
-   unsigned long dwKeyIndex,
-   PSKeyItem   *pKey
-)
-{
-   int i;
-
-   pr_debug("KeybGetKey()\n");
-
-   *pKey = NULL;
-   for (i = 0; i < MAX_KEY_TABLE; i++) {
-   if (pTable->KeyTable[i].bInUse &&
-   ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
-   if (dwKeyIndex == 0x) {
-   if (pTable->KeyTable[i].PairwiseKey.bKeyValid) {
-   *pKey = 
&(pTable->KeyTable[i].PairwiseKey);
-   return true;
-   } else {
-   return false;
-   }
-   } else if (dwKeyIndex < MAX_GROUP_KEY) {
- 

[PATCH v2 36/48] staging: vt6655: dead code remove tether.h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/baseband.c|   1 -
 drivers/staging/vt6655/baseband.h|   1 -
 drivers/staging/vt6655/desc.h|   1 -
 drivers/staging/vt6655/device.h  |   3 -
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/key.h |   1 -
 drivers/staging/vt6655/mac.c |   1 -
 drivers/staging/vt6655/mib.h |   1 -
 drivers/staging/vt6655/rxtx.c|   1 -
 drivers/staging/vt6655/srom.c|   1 -
 drivers/staging/vt6655/tether.h  | 188 ---
 11 files changed, 200 deletions(-)
 delete mode 100644 drivers/staging/vt6655/tether.h

diff --git a/drivers/staging/vt6655/baseband.c 
b/drivers/staging/vt6655/baseband.c
index c7ad927..ed78505 100644
--- a/drivers/staging/vt6655/baseband.c
+++ b/drivers/staging/vt6655/baseband.c
@@ -50,7 +50,6 @@
  */
 
 #include "tmacro.h"
-#include "tether.h"
 #include "mac.h"
 #include "baseband.h"
 #include "srom.h"
diff --git a/drivers/staging/vt6655/baseband.h 
b/drivers/staging/vt6655/baseband.h
index 31f2255..2d7a3e2 100644
--- a/drivers/staging/vt6655/baseband.h
+++ b/drivers/staging/vt6655/baseband.h
@@ -31,7 +31,6 @@
 #define __BASEBAND_H__
 
 #include "ttype.h"
-#include "tether.h"
 #include "device.h"
 
 /*
diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
index b59405b..32dd1ca 100644
--- a/drivers/staging/vt6655/desc.h
+++ b/drivers/staging/vt6655/desc.h
@@ -35,7 +35,6 @@
 #include 
 #include "linux/ieee80211.h"
 #include "ttype.h"
-#include "tether.h"
 
 #define B_OWNED_BY_CHIP 1
 #define B_OWNED_BY_HOST 0
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index f73239f..4d9d60b 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -69,7 +69,6 @@
 #include "device_cfg.h"
 #include "ttype.h"
 #include "80211hdr.h"
-#include "tether.h"
 #include "wmgr.h"
 #include "mib.h"
 #include "srom.h"
@@ -633,8 +632,6 @@ struct vnt_private {
unsigned long uNumSQ3[MAX_RATE];
unsigned short wAntDiversityMaxRate;
 
-   SEthernetHeader sTxEthHeader;
-   SEthernetHeader sRxEthHeader;
unsigned char abyBroadcastAddr[ETH_ALEN];
unsigned char abySNAP_RFC1042[ETH_ALEN];
unsigned char abySNAP_Bridgetunnel[ETH_ALEN];
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index dfaec04..2327369 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -58,7 +58,6 @@
 #include "channel.h"
 #include "baseband.h"
 #include "mac.h"
-#include "tether.h"
 #include "wmgr.h"
 #include "power.h"
 #include "iocmd.h"
diff --git a/drivers/staging/vt6655/key.h b/drivers/staging/vt6655/key.h
index 56d1b05..53b4606 100644
--- a/drivers/staging/vt6655/key.h
+++ b/drivers/staging/vt6655/key.h
@@ -33,7 +33,6 @@
 #include 
 
 #include "ttype.h"
-#include "tether.h"
 #include "80211mgr.h"
 
 /*-  Export Definitions -*/
diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index a347f39..955dbfe 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -69,7 +69,6 @@
  */
 
 #include "tmacro.h"
-#include "tether.h"
 #include "mac.h"
 
 unsigned short TxRate_iwconfig;//2008-5-8  by chester
diff --git a/drivers/staging/vt6655/mib.h b/drivers/staging/vt6655/mib.h
index fdb40f2..a2e6106 100644
--- a/drivers/staging/vt6655/mib.h
+++ b/drivers/staging/vt6655/mib.h
@@ -30,7 +30,6 @@
 #define __MIB_H__
 
 #include "ttype.h"
-#include "tether.h"
 #include "desc.h"
 
 //
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 246a250..f4da7e7 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -50,7 +50,6 @@
 
 #include "device.h"
 #include "rxtx.h"
-#include "tether.h"
 #include "card.h"
 #include "mac.h"
 #include "baseband.h"
diff --git a/drivers/staging/vt6655/srom.c b/drivers/staging/vt6655/srom.c
index 5396e58..1ac60fb 100644
--- a/drivers/staging/vt6655/srom.c
+++ b/drivers/staging/vt6655/srom.c
@@ -44,7 +44,6 @@
 
 #include "upc.h"
 #include "tmacro.h"
-#include "tether.h"
 #include "mac.h"
 #include "srom.h"
 
diff --git a/drivers/staging/vt6655/tether.h b/drivers/staging/vt6655/tether.h
deleted file mode 100644
index 850554c..000
--- a/drivers/staging/vt6655/tether.h
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A 

[PATCH v2 24/48] staging: vt6655: mib remove unused functions and structure members

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/mib.c | 423 ---
 drivers/staging/vt6655/mib.h | 259 --
 2 files changed, 682 deletions(-)

diff --git a/drivers/staging/vt6655/mib.c b/drivers/staging/vt6655/mib.c
index 111c018..d2f351d 100644
--- a/drivers/staging/vt6655/mib.c
+++ b/drivers/staging/vt6655/mib.c
@@ -25,24 +25,15 @@
  * Date: May 21, 1996
  *
  * Functions:
- *  STAvClearAllCounter - Clear All MIB Counter
  *  STAvUpdateIstStatCounter - Update ISR statistic counter
- *  STAvUpdateRDStatCounter - Update Rx statistic counter
- *  STAvUpdateRDStatCounterEx - Update Rx statistic counter and copy rcv 
data
- *  STAvUpdateTDStatCounter - Update Tx statistic counter
- *  STAvUpdateTDStatCounterEx - Update Tx statistic counter and copy tx 
data
  *  STAvUpdate802_11Counter - Update 802.11 mib counter
  *
  * Revision History:
  *
  */
 
-#include "upc.h"
 #include "mac.h"
-#include "tether.h"
 #include "mib.h"
-#include "wctl.h"
-#include "baseband.h"
 
 /*-  Static Classes  */
 
@@ -55,24 +46,6 @@
 /*-  Export Functions  --*/
 
 /*
- * Description: Clear All Statistic Counter
- *
- * Parameters:
- *  In:
- *  pStatistic  - Pointer to Statistic Counter Data Structure
- *  Out:
- *  none
- *
- * Return Value: none
- *
- */
-void STAvClearAllCounter(PSStatCounter pStatistic)
-{
-   // set memory to zero
-   memset(pStatistic, 0, sizeof(SStatCounter));
-}
-
-/*
  * Description: Update Isr Statistic Counter
  *
  * Parameters:
@@ -139,373 +112,6 @@ void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, 
unsigned long dwIsr)
 }
 
 /*
- * Description: Update Rx Statistic Counter
- *
- * Parameters:
- *  In:
- *  pStatistic  - Pointer to Statistic Counter Data Structure
- *  byRSR   - Rx Status
- *  byNewRSR- Rx Status
- *  pbyBuffer   - Rx Buffer
- *  cbFrameLength   - Rx Length
- *  Out:
- *  none
- *
- * Return Value: none
- *
- */
-void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
-unsigned char byRSR, unsigned char byNewRSR, 
unsigned char byRxRate,
-unsigned char *pbyBuffer, unsigned int 
cbFrameLength)
-{
-   //need change
-   PS802_11Header pHeader = (PS802_11Header)pbyBuffer;
-
-   if (byRSR & RSR_ADDROK)
-   pStatistic->dwRsrADDROk++;
-   if (byRSR & RSR_CRCOK) {
-   pStatistic->dwRsrCRCOk++;
-
-   pStatistic->ullRsrOK++;
-
-   if (cbFrameLength >= ETH_ALEN) {
-   // update counters in case of successful transmit
-   if (byRSR & RSR_ADDRBROAD) {
-   pStatistic->ullRxBroadcastFrames++;
-   pStatistic->ullRxBroadcastBytes += (unsigned 
long long) cbFrameLength;
-   } else if (byRSR & RSR_ADDRMULTI) {
-   pStatistic->ullRxMulticastFrames++;
-   pStatistic->ullRxMulticastBytes += (unsigned 
long long) cbFrameLength;
-   } else {
-   pStatistic->ullRxDirectedFrames++;
-   pStatistic->ullRxDirectedBytes += (unsigned 
long long) cbFrameLength;
-   }
-   }
-   }
-
-   if (byRxRate == 22) {
-   pStatistic->CustomStat.ullRsr11M++;
-   if (byRSR & RSR_CRCOK)
-   pStatistic->CustomStat.ullRsr11MCRCOk++;
-
-   pr_debug("11M: ALL[%d], OK[%d]:[%02x]\n",
-(int)pStatistic->CustomStat.ullRsr11M,
-(int)pStatistic->CustomStat.ullRsr11MCRCOk, byRSR);
-   } else if (byRxRate == 11) {
-   pStatistic->CustomStat.ullRsr5M++;
-   if (byRSR & RSR_CRCOK)
-   pStatistic->CustomStat.ullRsr5MCRCOk++;
-
-   pr_debug(" 5M: ALL[%d], OK[%d]:[%02x]\n",
-(int)pStatistic->CustomStat.ullRsr5M,
-(int)pStatistic->CustomStat.ullRsr5MCRCOk, byRSR);
-   } else if (byRxRate == 4) {
-   pStatistic->CustomStat.ullRsr2M++;
-   if (byRSR & RSR_CRCOK)
-   pStatistic->CustomStat.ullRsr2MCRCOk++;
-
-   pr_debug(" 2M: ALL[%d], OK[%d]:[%02x]\n",
-(int)pStatistic->CustomStat.ullRsr2M,
-(int)pStatistic->CustomStat.ullRsr2MCRCOk, byRSR);
-   } else if (byRxRate == 2) {
-   pStatistic->CustomStat.ullRsr1M++;
-   if (byRSR & RSR_CRCOK)
-   pStatistic->CustomStat.ullRsr1MCRCOk++;
-
-   pr_debug(" 1M: ALL[%d], OK[%d]:[%02x]\n",
-(int)pStatistic->CustomStat.ullRsr1M,
-(int)pS

[PATCH v2 46/48] staging: vt6655: move MAKE_BEACON_RESERVED to device.h

2014-10-29 Thread Malcolm Priestley
Used only in function device_intr in device_main.c move macro.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h | 2 ++
 drivers/staging/vt6655/wmgr.h   | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index e0c4069..45181a8 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -137,6 +137,8 @@
 #define RUN_AT(x)   (jiffies+(x))
 #endif
 
+#define MAKE_BEACON_RESERVED   10  /* (us) */
+
 /* DMA related */
 #define RESERV_AC0DMA   4
 
diff --git a/drivers/staging/vt6655/wmgr.h b/drivers/staging/vt6655/wmgr.h
index daf996c..ea23c79 100644
--- a/drivers/staging/vt6655/wmgr.h
+++ b/drivers/staging/vt6655/wmgr.h
@@ -54,8 +54,6 @@
 
 #define DEFAULT_MGN_LIFETIME8// ms
 
-#define MAKE_BEACON_RESERVED10  //(us)
-
 #define TIM_MULTICAST_MASK   0x01
 #define TIM_BITMAPOFFSET_MASK0xFE
 #define DEFAULT_DTIM_PERIOD 1
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 32/48] staging: vt6655: wmgr.h remove management structures

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h |   5 --
 drivers/staging/vt6655/wmgr.h   | 194 
 2 files changed, 199 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 5e48608..d2779a3 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -426,11 +426,6 @@ struct vnt_private {
/* 802.11 counter */
SDot11Counters  s802_11Counter;
 
-   /* 802.11 management */
-   PSMgmtObjectpMgmt;
-   SMgmtObject sMgmtObj;
-
-   /* 802.11 MAC specific */
unsigned intuCurrRSSI;
unsigned char byCurrSQ;
 
diff --git a/drivers/staging/vt6655/wmgr.h b/drivers/staging/vt6655/wmgr.h
index ecbb8d4..1deedd8 100644
--- a/drivers/staging/vt6655/wmgr.h
+++ b/drivers/staging/vt6655/wmgr.h
@@ -112,199 +112,5 @@ typedef struct tagSAssocInfo {
unsigned long RequestIELength;
unsigned char abyReqIEs[WLAN_BEACON_FR_MAXLEN];
 } SAssocInfo, *PSAssocInfo;
-//---
-
-typedef enum tagWMAC_SCAN_TYPE {
-   WMAC_SCAN_ACTIVE,
-   WMAC_SCAN_PASSIVE,
-   WMAC_SCAN_HYBRID
-} WMAC_SCAN_TYPE, *PWMAC_SCAN_TYPE;
-
-typedef enum tagWMAC_SCAN_STATE {
-   WMAC_NO_SCANNING,
-   WMAC_IS_SCANNING,
-   WMAC_IS_PROBEPENDING
-} WMAC_SCAN_STATE, *PWMAC_SCAN_STATE;
-
-// Notes:
-// Basic Service Set state explained as following:
-// WMAC_STATE_IDLE  : no BSS is selected (Adhoc or Infra)
-// WMAC_STATE_STARTED   : no BSS is selected, start own IBSS (Adhoc only)
-// WMAC_STATE_JOINTED   : BSS is selected and synchronized (Adhoc or Infra)
-// WMAC_STATE_AUTHPENDING   : Authentication pending (Infra)
-// WMAC_STATE_AUTH  : Authenticated (Infra)
-// WMAC_STATE_ASSOCPENDING  : Association pending (Infra)
-// WMAC_STATE_ASSOC : Associated (Infra)
-
-typedef enum tagWMAC_BSS_STATE {
-   WMAC_STATE_IDLE,
-   WMAC_STATE_STARTED,
-   WMAC_STATE_JOINTED,
-   WMAC_STATE_AUTHPENDING,
-   WMAC_STATE_AUTH,
-   WMAC_STATE_ASSOCPENDING,
-   WMAC_STATE_ASSOC
-} WMAC_BSS_STATE, *PWMAC_BSS_STATE;
-
-// WMAC selected running mode
-typedef enum tagWMAC_CURRENT_MODE {
-   WMAC_MODE_STANDBY,
-   WMAC_MODE_ESS_STA,
-   WMAC_MODE_IBSS_STA,
-   WMAC_MODE_ESS_AP
-} WMAC_CURRENT_MODE, *PWMAC_CURRENT_MODE;
-
-/*
-  typedef enum tagWMAC_POWER_MODE {
-  WMAC_POWER_CAM,
-  WMAC_POWER_FAST,
-  WMAC_POWER_MAX
-
-  } WMAC_POWER_MODE, *PWMAC_POWER_MODE;
-*/
-
-// Tx Management Packet descriptor
-typedef struct tagSTxMgmtPacket {
-   PUWLAN_80211HDR p80211Header;
-   unsigned int cbMPDULen;
-   unsigned int cbPayloadLen;
-} STxMgmtPacket, *PSTxMgmtPacket;
-
-// Rx Management Packet descriptor
-typedef struct tagSRxMgmtPacket {
-   PUWLAN_80211HDR p80211Header;
-   u64 qwLocalTSF;
-   unsigned int cbMPDULen;
-   unsigned int cbPayloadLen;
-   unsigned int uRSSI;
-   unsigned char bySQ;
-   unsigned char byRxRate;
-   unsigned char byRxChannel;
-} SRxMgmtPacket, *PSRxMgmtPacket;
-
-typedef struct tagSMgmtObject {
-   void *pAdapter;
-   // MAC address
-   unsigned char abyMACAddr[WLAN_ADDR_LEN];
-
-   // Configuration Mode
-   CARD_PHY_TYPE   eCurrentPHYMode;
-   CARD_PHY_TYPE   eConfigPHYMode;
-
-   // Operation state variables
-   WMAC_CURRENT_MODE   eCurrMode;   // MAC current connection mode
-   WMAC_BSS_STATE  eCurrState;  // MAC current BSS state
-
-   PKnownBSS   pCurrBSS;
-   unsigned char byCSSGK;
-   unsigned char byCSSPK;
-
-   // Current state vars
-   unsigned intuCurrChannel;
-   unsigned char abyCurrBSSID[WLAN_BSSID_LEN];
-   unsigned char abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1];
-   unsigned char abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 
1];
-   unsigned char abyCurrSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
-   unsigned short wCurrCapInfo;
-   unsigned short wCurrAID;
-   unsigned short wCurrATIMWindow;
-   unsigned short wCurrBeaconPeriod;
-   bool bIsDS;
-   unsigned char byERPContext;
-
-   CMD_STATE   eCommandState;
-   unsigned intuScanChannel;
-
-   // Desire joining BSS vars
-   unsigned char abyDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
-   unsigned char abyDesireBSSID[WLAN_BSSID_LEN];
-
-   // Adhoc or AP configuration vars
-   unsigned short wIBSSBeaconPeriod;
-   unsigned short wIBSSATIMWindow;
-   unsigned intuIBSSChannel;
-   unsigned char abyIBSSSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1];
-   unsigned char byAPBBType;
-   unsigned char abyWPAIE[MAX_WPA_IE_LEN];
-   unsigned short wWPAIELen;
-
-   unsigned intuAssocCount;
-   bool bMoreData;
-
-   // Scan state vars
-   WMAC_SCAN_STATE eScanSta

[PATCH v2 42/48] staging: vt6655: device.h remove dead strutures and macros

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h | 76 -
 1 file changed, 76 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index bc33b2d..79c4ae0 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -147,16 +147,6 @@
 
 #defineNUM 64
 
-#define PRIVATE_Message 0
-
-/*-  Export Types  --*/
-
-#define PRINT_K(p, args...)\
-do {   \
-   if (PRIVATE_Message)\
-   printk(p, ##args);  \
-} while (0)
-
 /* 0:11A 1:11B 2:11G */
 typedef enum _VIA_BB_TYPE
 {
@@ -174,57 +164,6 @@ typedef enum _VIA_PKT_TYPE
PK_TYPE_11GA
 } VIA_PKT_TYPE, *PVIA_PKT_TYPE;
 
-typedef enum __device_msg_level {
-   MSG_LEVEL_ERR = 0,  /* Errors that will cause abnormal operation. */
-   MSG_LEVEL_NOTICE = 1,   /* Some errors need users to be notified. */
-   MSG_LEVEL_INFO = 2, /* Normal message. */
-   MSG_LEVEL_VERBOSE = 3,  /* Will report all trival errors. */
-   MSG_LEVEL_DEBUG = 4 /* Only for debug purpose. */
-} DEVICE_MSG_LEVEL, *PDEVICE_MSG_LEVEL;
-
-/* NDIS related */
-#define MAX_BSSIDINFO_4_PMKID   16
-#define MAX_PMKIDLIST   5
-/* Flags for PMKID Candidate list structure */
-#define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED0x01
-
-/* PMKID Structures */
-typedef unsigned char NDIS_802_11_PMKID_VALUE[16];
-
-typedef enum _NDIS_802_11_WEP_STATUS {
-   Ndis802_11WEPEnabled,
-   Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
-   Ndis802_11WEPDisabled,
-   Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
-   Ndis802_11WEPKeyAbsent,
-   Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
-   Ndis802_11WEPNotSupported,
-   Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
-   Ndis802_11Encryption2Enabled,
-   Ndis802_11Encryption2KeyAbsent,
-   Ndis802_11Encryption3Enabled,
-   Ndis802_11Encryption3KeyAbsent
-} NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
-   NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
-
-typedef enum _NDIS_802_11_STATUS_TYPE {
-   Ndis802_11StatusType_Authentication,
-   Ndis802_11StatusType_MediaStreamMode,
-   Ndis802_11StatusType_PMKID_CandidateList,
-   Ndis802_11StatusTypeMax/* defined as an upper bound */
-} NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
-
-
-/* 802.11h related */
-#define MAX_QUIET_COUNT 8
-
-typedef struct tagSQuietControl {
-   bool bEnable;
-   unsigned long dwStartTime;
-   unsigned char byPeriod;
-   unsigned short wDuration;
-} SQuietControl, *PSQuietControl;
-
 typedef struct __chip_info_tbl {
CHIP_TYPE   chip_id;
char *name;
@@ -238,20 +177,6 @@ typedef enum {
OWNED_BY_NIC = 1
 } DEVICE_OWNER_TYPE, *PDEVICE_OWNER_TYPE;
 
-/* The receive duplicate detection cache entry */
-typedef struct tagSCacheEntry {
-   unsigned short wFmSequence;
-   unsigned char abyAddr2[ETH_ALEN];
-} SCacheEntry, *PSCacheEntry;
-
-typedef struct tagSCache {
-/* The receive cache is updated circularly. The next entry to be written is
- * indexed by the "InPtr".
- */
-   unsigned int uInPtr; /* Place to use next */
-   SCacheEntry asCacheEntry[DUPLICATE_RX_CACHE_LENGTH];
-} SCache, *PSCache;
-
 #define CB_MAX_RX_FRAG 64
 /* DeFragment Control Block, used for collecting fragments prior to reassembly 
*/
 typedef struct tagSDeFragControlBlock {
@@ -361,7 +286,6 @@ struct vnt_private {
volatile PSRxDesc   aRD0Ring;
volatile PSRxDesc   aRD1Ring;
volatile PSRxDesc   pCurrRD[TYPE_MAXRD];
-   SCache  sDupRxCache;
 
SDeFragControlBlock sRxDFCB[CB_MAX_RX_FRAG];
unsigned intcbDFCB;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 38/48] staging: vt6655: dead code remove iowpa.h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/iowpa.h   | 130 ---
 2 files changed, 131 deletions(-)
 delete mode 100644 drivers/staging/vt6655/iowpa.h

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 2327369..d5ab7c4 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -64,7 +64,6 @@
 #include "rxtx.h"
 #include "dpc.h"
 #include "rf.h"
-#include "iowpa.h"
 #include 
 #include 
 #include 
diff --git a/drivers/staging/vt6655/iowpa.h b/drivers/staging/vt6655/iowpa.h
deleted file mode 100644
index 7f79eae..000
--- a/drivers/staging/vt6655/iowpa.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: iowpa.h
- *
- * Purpose: Handles wpa supplicant ioctl interface
- *
- * Author: Lyndon Chen
- *
- * Date: May 8, 2002
- *
- */
-
-#ifndef __IOWPA_H__
-#define __IOWPA_H__
-
-#define WPA_IE_LEN 64
-
-/* WPA related */
-
-enum {
-   VIAWGET_SET_WPA = 1,
-   VIAWGET_SET_KEY = 2,
-   VIAWGET_SET_SCAN = 3,
-   VIAWGET_GET_SCAN = 4,
-   VIAWGET_GET_SSID = 5,
-   VIAWGET_GET_BSSID = 6,
-   VIAWGET_SET_DROP_UNENCRYPT = 7,
-   VIAWGET_SET_DEAUTHENTICATE = 8,
-   VIAWGET_SET_ASSOCIATE = 9,
-   VIAWGET_SET_DISASSOCIATE = 10
-};
-
-enum {
-   VIAWGET_ASSOC_MSG = 1,
-   VIAWGET_DISASSOC_MSG = 2,
-   VIAWGET_PTK_MIC_MSG = 3,
-   VIAWGET_GTK_MIC_MSG = 4,
-   VIAWGET_CCKM_ROAM_MSG = 5,
-   VIAWGET_DEVICECLOSE_MSG = 6
-};
-
-#pragma pack(1)
-typedef struct viawget_wpa_header {
-   u8 type;
-   u16 req_ie_len;
-   u16 resp_ie_len;
-} viawget_wpa_header;
-
-struct viawget_wpa_param {
-   u32 cmd;
-   u8 addr[6];
-   union {
-   struct {
-   u8 len;
-   u8 data[0];
-   } generic_elem;
-
-   struct {
-   u8 bssid[6];
-   u8 ssid[32];
-   u8 ssid_len;
-   u8 __user *wpa_ie;
-   u16 wpa_ie_len;
-   int pairwise_suite;
-   int group_suite;
-   int key_mgmt_suite;
-   int auth_alg;
-   int mode;
-
-   } wpa_associate;
-
-   struct {
-   int alg_name;
-   u16 key_index;
-   u16 set_tx;
-   u8 *seq;
-   u16 seq_len;
-   u8 *key;
-   u16 key_len;
-   } wpa_key;
-
-   struct {
-   u8 ssid_len;
-   u8 ssid[32];
-   } scan_req;
-
-   struct {
-   u16 scan_count;
-   u8 __user *buf;
-   } scan_results;
-
-   } u;
-};
-
-#pragma pack(1)
-struct viawget_scan_result {
-   u8 bssid[6];
-   u8 ssid[32];
-   u16 ssid_len;
-   u8 wpa_ie[WPA_IE_LEN];
-   u16 wpa_ie_len;
-   u8 rsn_ie[WPA_IE_LEN];
-   u16 rsn_ie_len;
-   int freq; /* MHz */
-   int caps; /* e.g. privacy */
-   int qual; /* signal quality */
-   int noise;
-   int level;
-   int maxrate;
-};
-
-#pragma pack()
-
-#endif /* __IOWPA_H__ */
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 39/48] staging: vt6655: dead code remove iocmd.h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/iocmd.h   | 386 ---
 2 files changed, 387 deletions(-)
 delete mode 100644 drivers/staging/vt6655/iocmd.h

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index d5ab7c4..7892f86 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -60,7 +60,6 @@
 #include "mac.h"
 #include "wmgr.h"
 #include "power.h"
-#include "iocmd.h"
 #include "rxtx.h"
 #include "dpc.h"
 #include "rf.h"
diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h
deleted file mode 100644
index 804c903..000
--- a/drivers/staging/vt6655/iocmd.h
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: iocmd.h
- *
- * Purpose: Handles the viawget ioctl private interface functions
- *
- * Author: Lyndon Chen
- *
- * Date: May 8, 2002
- *
- */
-
-#ifndef __IOCMD_H__
-#define __IOCMD_H__
-
-#include "ttype.h"
-
-/* ioctl Command code */
-#define MAGIC_CODE  0x3142
-#define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0)
-#define IOCTL_CMD_SET  (SIOCDEVPRIVATE + 1)
-#define IOCTL_CMD_HOSTAPD   (SIOCDEVPRIVATE + 2)
-#define IOCTL_CMD_WPA   (SIOCDEVPRIVATE + 3)
-
-typedef enum tagWMAC_CMD {
-   WLAN_CMD_BSS_SCAN,
-   WLAN_CMD_BSS_JOIN,
-   WLAN_CMD_DISASSOC,
-   WLAN_CMD_SET_WEP,
-   WLAN_CMD_GET_LINK,
-   WLAN_CMD_GET_LISTLEN,
-   WLAN_CMD_GET_LIST,
-   WLAN_CMD_GET_MIB,
-   WLAN_CMD_GET_STAT,
-   WLAN_CMD_STOP_MAC,
-   WLAN_CMD_START_MAC,
-   WLAN_CMD_AP_START,
-   WLAN_CMD_SET_HOSTAPD,
-   WLAN_CMD_SET_HOSTAPD_STA,
-   WLAN_CMD_SET_802_1X,
-   WLAN_CMD_SET_HOST_WEP,
-   WLAN_CMD_SET_WPA,
-   WLAN_CMD_GET_NODE_CNT,
-   WLAN_CMD_ZONETYPE_SET,
-   WLAN_CMD_GET_NODE_LIST
-} WMAC_CMD, *PWMAC_CMD;
-
-typedef enum tagWZONETYPE {
-   ZoneType_USA = 0,
-   ZoneType_Japan = 1,
-   ZoneType_Europe = 2
-} WZONETYPE;
-
-#define ADHOC  0
-#define INFRA  1
-#define BOTH   2
-#define AP 3
-
-#define ADHOC_STARTED 1
-#define ADHOC_JOINTED 2
-
-#define PHY80211a   0
-#define PHY80211b   1
-#define PHY80211g   2
-
-#define SSID_ID0
-#define SSID_MAXLEN32
-#define BSSID_LEN  6
-#define WEP_NKEYS  4
-#define WEP_KEYMAXLEN  29
-#define WEP_40BIT_LEN  5
-#define WEP_104BIT_LEN 13
-#define WEP_232BIT_LEN 16
-
-/* Ioctl interface structure, Command structure */
-#pragma pack(1)
-typedef struct tagSCmdRequest {
-   u8  name[16];
-   void __user *data;
-   u16 wResult;
-   u16 wCmdCode;
-} SCmdRequest, *PSCmdRequest;
-
-/* Scan */
-typedef struct tagSCmdScan {
-   u8 ssid[SSID_MAXLEN + 2];
-} SCmdScan, *PSCmdScan;
-
-/* BSS Join */
-typedef struct tagSCmdBSSJoin {
-   u16 wBSSType;
-   u16 wBBPType;
-   u8  ssid[SSID_MAXLEN + 2];
-   u32 uChannel;
-   bool bPSEnable;
-   bool bShareKeyAuth;
-} SCmdBSSJoin, *PSCmdBSSJoin;
-
-/* Zonetype Setting */
-typedef struct tagSCmdZoneTypeSet {
-   bool bWrite;
-   WZONETYPE  ZoneType;
-} SCmdZoneTypeSet, *PSCmdZoneTypeSet;
-
-#ifdef WPA_SM_Transtatus
-typedef struct tagSWPAResult {
-   charifname[100];
-   u8 proto;
-   u8 key_mgmt;
-   u8 eap_type;
-   bool authenticated;
-} SWPAResult, *PSWPAResult;
-#endif
-
-typedef struct tagSCmdStartAP {
-   u16 wBSSType;
-   u16 wBBPType;
-   u8  ssid[SSID_MAXLEN + 2];
-   u32 uChannel;
-   u32 uBeaconInt;
-   bool bShareKeyAuth;
-   u8  byBasicRate;
-} SCmdStartAP, *PSCmdStartAP;
-
-typedef struct tagSCmdSetWEP {
-   bool bEnableWep;
-   u8  byKeyIndex;
-   u8  abyWepKey[WEP_NKEYS][WEP_KEYMAXLEN];
-   bool bWepKeyAvailable[WEP_NKEYS];
-   u32 auWepKeyLength[WEP_NKEYS];
-} SCmdSetWEP, *PSCmdSetWEP;
-
-typedef struct tagSBSSIDItem {
-   u32 uChannel;
-   u8

[PATCH v2 37/48] staging: vt6655: dead code remove 80211mgr.h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/80211mgr.h | 615 --
 drivers/staging/vt6655/device.h   |   1 -
 drivers/staging/vt6655/key.h  |   1 -
 drivers/staging/vt6655/wmgr.h |   1 -
 4 files changed, 618 deletions(-)
 delete mode 100644 drivers/staging/vt6655/80211mgr.h

diff --git a/drivers/staging/vt6655/80211mgr.h 
b/drivers/staging/vt6655/80211mgr.h
deleted file mode 100644
index 94cff3b..000
--- a/drivers/staging/vt6655/80211mgr.h
+++ /dev/null
@@ -1,615 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: 80211mgr.h
- *
- * Purpose: 802.11 management frames pre-defines.
- *
- *
- * Author: Lyndon Chen
- *
- * Date: May 8, 2002
- *
- */
-
-#ifndef __80211MGR_H__
-#define __80211MGR_H__
-
-#include 
-#include "linux/ieee80211.h"
-
-#include "ttype.h"
-#include "80211hdr.h"
-
-#define WLAN_MIN_ARRAY  1
-
-/* Information Element ID value */
-#define WLAN_EID_FH_PARMS   2
-#define WLAN_EID_DS_PARMS   3
-#define WLAN_EID_CF_PARMS   4
-#define WLAN_EID_IBSS_PARMS 6
-#define WLAN_EID_TPC_REQ34
-#define WLAN_EID_TPC_REP35
-#define WLAN_EID_SUPP_CH36
-#define WLAN_EID_CH_SWITCH  37
-#define WLAN_EID_MEASURE_REQ38
-#define WLAN_EID_MEASURE_REP39
-#define WLAN_EID_QUIET  40
-#define WLAN_EID_IBSS_DFS   41
-#define WLAN_EID_ERP42
-/* reference 802.11i 7.3.2 table 20 */
-#define WLAN_EID_EXTSUPP_RATES  50
-/* reference WiFi WPA spec. */
-#define WLAN_EID_RSN_WPA221
-
-#define WLAN_EID_ERP_NONERP_PRESENT 0x01
-#define WLAN_EID_ERP_USE_PROTECTION 0x02
-#define WLAN_EID_ERP_BARKER_MODE0x04
-
-/* Reason Codes */
-#define WLAN_MGMT_REASON_RSVD   0
-#define WLAN_MGMT_REASON_UNSPEC 1
-#define WLAN_MGMT_REASON_PRIOR_AUTH_INVALID 2
-#define WLAN_MGMT_REASON_DEAUTH_LEAVING 3
-#define WLAN_MGMT_REASON_DISASSOC_INACTIVE  4
-#define WLAN_MGMT_REASON_DISASSOC_AP_BUSY   5
-#define WLAN_MGMT_REASON_CLASS2_NONAUTH 6
-#define WLAN_MGMT_REASON_CLASS3_NONASSOC7
-#define WLAN_MGMT_REASON_DISASSOC_STA_HASLEFT   8
-#define WLAN_MGMT_REASON_CANT_ASSOC_NONAUTH 9
-#define WLAN_MGMT_REASON_DISASSOC_PWR_CAP_UNACCEPT  10
-#define WLAN_MGMT_REASON_DISASSOC_SUPP_CH_UNACCEPT  11
-#define WLAN_MGMT_REASON_INVALID_IE 13
-#define WLAN_MGMT_REASON_MIC_FAILURE14
-#define WLAN_MGMT_REASON_4WAY_HANDSHAKE_TIMEOUT 15
-#define WLAN_MGMT_REASON_GRPKEY_UPDATE_TIMEOUT  16
-#define WLAN_MGMT_REASON_4WAY_INFO_DIFFERENT17
-#define WLAN_MGMT_REASON_MULTCAST_CIPHER_INVALID18
-#define WLAN_MGMT_REASON_UNCAST_CIPHER_INVALID  19
-#define WLAN_MGMT_REASON_AKMP_INVALID   20
-#define WLAN_MGMT_REASON_RSNE_UNSUPPORTED   21
-#define WLAN_MGMT_REASON_RSNE_CAP_INVALID   22
-#define WLAN_MGMT_REASON_80211X_AUTH_FAILED 23
-
-/* Status Codes */
-#define WLAN_MGMT_STATUS_SUCCESS0
-#define WLAN_MGMT_STATUS_UNSPEC_FAILURE 1
-#define WLAN_MGMT_STATUS_CAPS_UNSUPPORTED   10
-#define WLAN_MGMT_STATUS_REASSOC_NO_ASSOC   11
-#define WLAN_MGMT_STATUS_ASSOC_DENIED_UNSPEC12
-#define WLAN_MGMT_STATUS_UNSUPPORTED_AUTHALG13
-#define WLAN_MGMT_STATUS_RX_AUTH_NOSEQ  14
-#define WLAN_MGMT_STATUS_CHALLENGE_FAIL 15
-#define WLAN_MGMT_STATUS_AUTH_TIMEOUT   16
-#define WLAN_MGMT_STATUS_ASSOC_DENIED_BUSY  17
-#define WLAN_MGMT_STATUS_ASSOC_DENIED_RATES 18
-#define WLAN_MGMT_STATUS_ASSOC_DENIED_SHORTPREAMBLE 19
-#define WLAN_MGMT_STATUS_ASSOC_DENIED_PBCC  20
-#define WLAN_MGMT_STATUS_ASSOC_DENIED_AGILITY   21
-
-/* reference 802.11h 7.3.1.9 */
-#define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_SPECTRUM_MNG  22
-#define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_PWR_CAP   23
-#define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_SUPP_CH   24
-/* reference 802.11g 7.3.1.9 */
-#define WLAN_MGMT_STATUS_SHORTSLOTTIME_UNSUPPORTED  25
-#define WLAN_MGMT_

[PATCH v2 43/48] staging: vt6655: dead code remove 80211hdr.h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/80211hdr.h | 318 --
 drivers/staging/vt6655/device.h   |   1 -
 drivers/staging/vt6655/wmgr.h |   1 -
 3 files changed, 320 deletions(-)
 delete mode 100644 drivers/staging/vt6655/80211hdr.h

diff --git a/drivers/staging/vt6655/80211hdr.h 
b/drivers/staging/vt6655/80211hdr.h
deleted file mode 100644
index 36e14ec..000
--- a/drivers/staging/vt6655/80211hdr.h
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: 80211hdr.h
- *
- * Purpose: 802.11 MAC headers related pre-defines and macros.
- *
- *
- * Author: Lyndon Chen
- *
- * Date: Apr 8, 2002
- *
- */
-
-#ifndef __80211HDR_H__
-#define __80211HDR_H__
-
-#include "ttype.h"
-
-/* bit type */
-#define BIT0   0x0001
-#define BIT1   0x0002
-#define BIT2   0x0004
-#define BIT3   0x0008
-#define BIT4   0x0010
-#define BIT5   0x0020
-#define BIT6   0x0040
-#define BIT7   0x0080
-#define BIT8   0x0100
-#define BIT9   0x0200
-#define BIT10  0x0400
-#define BIT11  0x0800
-#define BIT12  0x1000
-#define BIT13  0x2000
-#define BIT14  0x4000
-#define BIT15  0x8000
-#define BIT16  0x0001
-#define BIT17  0x0002
-#define BIT18  0x0004
-#define BIT19  0x0008
-#define BIT20  0x0010
-#define BIT21  0x0020
-#define BIT22  0x0040
-#define BIT23  0x0080
-#define BIT24  0x0100
-#define BIT25  0x0200
-#define BIT26  0x0400
-#define BIT27  0x0800
-#define BIT28  0x1000
-#define BIT29  0x2000
-#define BIT30  0x4000
-#define BIT31  0x8000
-
-/* 802.11 frame related, defined as 802.11 spec */
-#define WLAN_ADDR_LEN   6
-#define WLAN_CRC_LEN4
-#define WLAN_CRC32_LEN  4
-#define WLAN_FCS_LEN4
-#define WLAN_BSSID_LEN  6
-#define WLAN_BSS_TS_LEN 8
-#define WLAN_HDR_ADDR2_LEN  16
-#define WLAN_HDR_ADDR3_LEN  24
-#define WLAN_HDR_ADDR4_LEN  30
-#define WLAN_IEHDR_LEN  2
-#define WLAN_SSID_MAXLEN32
-#define WLAN_RATES_MAXLEN   16
-#define WLAN_RATES_MAXLEN_11B   4
-#define WLAN_RSN_MAXLEN 32
-#define WLAN_DATA_MAXLEN2312
-#define WLAN_A3FR_MAXLEN(WLAN_HDR_ADDR3_LEN + WLAN_DATA_MAXLEN + \
-WLAN_CRC_LEN)
-
-#define WLAN_BEACON_FR_MAXLEN   WLAN_A3FR_MAXLEN
-#define WLAN_ATIM_FR_MAXLEN (WLAN_HDR_ADDR3_LEN + 0)
-#define WLAN_NULLDATA_FR_MAXLEN (WLAN_HDR_ADDR3_LEN + 0)
-#define WLAN_DISASSOC_FR_MAXLEN (WLAN_HDR_ADDR3_LEN + 2)
-#define WLAN_ASSOCREQ_FR_MAXLEN WLAN_A3FR_MAXLEN
-#define WLAN_ASSOCRESP_FR_MAXLENWLAN_A3FR_MAXLEN
-#define WLAN_REASSOCREQ_FR_MAXLEN   WLAN_A3FR_MAXLEN
-#define WLAN_REASSOCRESP_FR_MAXLEN  WLAN_A3FR_MAXLEN
-#define WLAN_PROBEREQ_FR_MAXLEN WLAN_A3FR_MAXLEN
-#define WLAN_PROBERESP_FR_MAXLENWLAN_A3FR_MAXLEN
-#define WLAN_AUTHEN_FR_MAXLEN   WLAN_A3FR_MAXLEN
-#define WLAN_DEAUTHEN_FR_MAXLEN (WLAN_HDR_ADDR3_LEN + 2)
-
-#define WLAN_WEP_NKEYS  4
-#define WLAN_WEP40_KEYLEN   5
-#define WLAN_WEP104_KEYLEN  13
-#define WLAN_WEP232_KEYLEN  29
-#define WLAN_WEPMAX_KEYLEN  32
-#define WLAN_CHALLENGE_IE_MAXLEN255
-#define WLAN_CHALLENGE_IE_LEN   130
-#define WLAN_CHALLENGE_LEN  128
-#define WLAN_WEP_IV_LEN 4
-#define WLAN_WEP_ICV_LEN4
-#define WLAN_FRAGS_MAX  16
-
-/* Frame Type */
-#define WLAN_TYPE_MGR 0x00
-#define WLAN_TYPE_CTL  0x01
-#define WLAN_TYPE_DATA 0x02
-
-#define WLAN_FTYPE_MGMT 0x00
-#define WLAN_FTYPE_CTL  0x01
-#define WLAN_FTYPE_DATA 0x02
-
-/* Frame Subtypes */
-#define WLAN_FSTYPE_ASSOCREQ0x00
-#define WLAN_FSTYPE_ASSOCRESP   0x01
-#define WLAN_FSTYPE_REASSOCREQ  0x02
-#define WLAN_FSTYPE_REASSOCRESP 0x03
-#define WLAN_FSTYPE_PROBEREQ0x04
-#define WLAN_FSTYPE_PROBERESP   0x05
-#define WLAN_FSTYPE_BEACON  0x08
-#define WLAN_FSTYPE_ATIM0x09
-#define WLAN_FSTYPE_DISASSOC0x0a
-#define WLAN_FSTYPE_AUTHEN  0x0b
-#define WLAN

[PATCH v2 41/48] staging: vt6655: struct vnt_private remove dead members

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h | 153 +---
 1 file changed, 1 insertion(+), 152 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 1816f3c..bc33b2d 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -317,8 +317,6 @@ struct vnt_private {
u16 current_aid;
int mc_list_count;
u8 mac_hw;
-/* netdev */
-   struct net_device *dev;
 
 /* dma addr, rx/tx pool */
dma_addr_t  pool_dma;
@@ -378,10 +376,6 @@ struct vnt_private {
u8 rx_rate;
int multicast_limit;
 
-   pid_t   MLMEThr_pid;
-   struct completion   notify;
-   struct semaphoremlme_semaphore;
-
u32 rx_bytes;
 
/* Version control */
@@ -392,7 +386,7 @@ struct vnt_private {
unsigned char byZoneType;
bool bZoneRegExist;
unsigned char byOriginalZonetype;
-   unsigned char abyMacContext[MAC_MAX_CONTEXT_REG];
+
unsigned char abyCurrentNetAddr[ETH_ALEN];
bool bLinkPass;  /* link status: OK or fail */
 
@@ -453,14 +447,6 @@ struct vnt_private {
unsigned char byOpMode;
bool bBSSIDFilter;
unsigned short wMaxTransmitMSDULifetime;
-   unsigned char abyBSSID[ETH_ALEN];
-   unsigned char abyDesireBSSID[ETH_ALEN];
-   unsigned short wACKDuration;/* update while speed change */
-   unsigned short wRTSTransmitLen; /* update while speed change */
-   unsigned char byRTSServiceField;/* update while speed change */
-   unsigned char byRTSSignalField; /* update while speed change */
-
-   unsigned long dwMaxReceiveLifetime; /* dot11MaxReceiveLifetime */
 
bool bEncryptionEnable;
bool bLongHeader;
@@ -469,9 +455,6 @@ struct vnt_private {
bool bNonERPPresent;
bool bBarkerPreambleMd;
 
-   unsigned char byERPFlag;
-   unsigned short wUseProtectCntDown;
-
bool bRadioControlOff;
bool bRadioOff;
bool bEnablePSMode;
@@ -494,61 +477,11 @@ struct vnt_private {
unsigned intcbBeaconBufReadySetCnt;
bool bFixRate;
unsigned char byCurrentCh;
-   unsigned intuScanTime;
-
-   bool bBeaconTx;
-
-   bool bStopBeacon;
-   bool bStopDataPkt;
-   bool bStopTx0Pkt;
-   unsigned intuAutoReConnectTime;
-
-   /* 802.11 counter */
-
-   unsigned intuCmdDequeueIdx;
-   unsigned intuCmdEnqueueIdx;
-   unsigned intcbFreeCmdQueue;
-   bool bCmdRunning;
-   bool bCmdClear;
-
-   bool bRoaming;
-   unsigned char abyIPAddr[4];
-
-   unsigned long ulTxPower;
-   NDIS_802_11_WEP_STATUS  eEncryptionStatus;
-   bool bTransmitKey;
-   NDIS_802_11_WEP_STATUS  eOldEncryptionStatus;
-
-   unsigned long dwIVCounter;
-
-   u64 qwPacketNumber; /* For CCMP and TKIP as TSC(6 bytes) */
-   unsigned intuCurrentWEPMode;
-
-   unsigned char abyPRNG[WLAN_WEPMAX_KEYLEN+3];
-   unsigned char byKeyIndex;
-   unsigned intuKeyLength;
-   unsigned char abyKey[WLAN_WEP232_KEYLEN];
 
bool bAES;
-   unsigned char byCntMeasure;
-
-   /* for AP mode */
-   unsigned intuAssocCount;
-   bool bMoreData;
-
-   /* QoS */
-   bool bGrpAckPolicy;
-
-   /* for OID_802_11_ASSOCIATION_INFORMATION */
-   bool bAssocInfoSet;
 
unsigned char byAutoFBCtrl;
 
-   bool bTxMICFail;
-   bool bRxMICFail;
-
-   unsigned intuRATEIdx;
-
/* For Update BaseBand VGA Gain Offset */
bool bUpdateBBVGA;
unsigned intuBBVGADiffCount;
@@ -560,22 +493,11 @@ struct vnt_private {
unsigned char byBBPreEDRSSI;
unsigned char byBBPreEDIndex;
 
-   bool bRadioCmd;
unsigned long dwDiagRefCount;
 
/* For FOE Tuning */
unsigned char byFOETuning;
 
-   /* For Auto Power Tunning */
-   unsigned char byAutoPwrTunning;
-   short   sPSetPointCCK;
-   short   sPSetPointOFDMG;
-   short   sPSetPointOFDMA;
-   longlPFormulaOffset;
-   short   sPThreshold;
-   charcAdjustStep;
-   charcMinTxAGC;
-
/* For RF Power table */
unsigned char byCCKPwr;
unsigned char byOFDMPwrG;
@@ -594,21 +516,6 @@ struct vnt_private {
unsigned char byBBCR88;
unsigned char byBBCR09;
 
-   /* command timer */
-   struct timer_list   sTimerCommand;
-   struct timer_list   sTimerTxData;
-   unsigned long nTxDataTimeCout;
-   bool fTxDataInSleep;
-   bool IsTxDataTrigger;
-
-#ifdef WPA_SM_Transtatus
-   bool fWPA_Authened; /* is WPA/WPA-PSK or WPA2/WPA2-PSK authen

[PATCH v2 47/48] staging: vt6655: dead code remove wmgr.h

2014-10-29 Thread Malcolm Priestley
on removal needs to be replaced by card.h in device.h

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h  |  2 +-
 drivers/staging/vt6655/device_main.c |  1 -
 drivers/staging/vt6655/power.c   |  1 -
 drivers/staging/vt6655/wmgr.h| 72 
 4 files changed, 1 insertion(+), 75 deletions(-)
 delete mode 100644 drivers/staging/vt6655/wmgr.h

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 45181a8..d0855bd 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -68,7 +68,7 @@
 
 #include "device_cfg.h"
 #include "ttype.h"
-#include "wmgr.h"
+#include "card.h"
 #include "mib.h"
 #include "srom.h"
 #include "desc.h"
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 5c91c2f..f0b336b 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -58,7 +58,6 @@
 #include "channel.h"
 #include "baseband.h"
 #include "mac.h"
-#include "wmgr.h"
 #include "power.h"
 #include "rxtx.h"
 #include "dpc.h"
diff --git a/drivers/staging/vt6655/power.c b/drivers/staging/vt6655/power.c
index 6f83650..a8aedee 100644
--- a/drivers/staging/vt6655/power.c
+++ b/drivers/staging/vt6655/power.c
@@ -40,7 +40,6 @@
 #include "ttype.h"
 #include "mac.h"
 #include "device.h"
-#include "wmgr.h"
 #include "power.h"
 #include "card.h"
 
diff --git a/drivers/staging/vt6655/wmgr.h b/drivers/staging/vt6655/wmgr.h
deleted file mode 100644
index ea23c79..000
--- a/drivers/staging/vt6655/wmgr.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: wmgr.h
- *
- * Purpose:
- *
- * Author: lyndon chen
- *
- * Date: Jan 2, 2003
- *
- * Functions:
- *
- * Revision History:
- *
- */
-
-#ifndef __WMGR_H__
-#define __WMGR_H__
-
-#include "ttype.h"
-#include "card.h"
-
-/*-  Export Definitions -*/
-
-// Scan time
-#define PROBE_DELAY  100  // (us)
-#define SWITCH_CHANNEL_DELAY 200 // (us)
-#define WLAN_SCAN_MINITIME   25   // (ms)
-#define WLAN_SCAN_MAXTIME100  // (ms)
-#define TRIVIAL_SYNC_DIFFERENCE  0// (us)
-#define DEFAULT_IBSS_BI  100  // (ms)
-
-#define WCMD_ACTIVE_SCAN_TIME   50 //(ms)
-#define WCMD_PASSIVE_SCAN_TIME  100 //(ms)
-
-#define DEFAULT_MSDU_LIFETIME   512  // ms
-
-#define DEFAULT_MGN_LIFETIME8// ms
-
-#define TIM_MULTICAST_MASK   0x01
-#define TIM_BITMAPOFFSET_MASK0xFE
-#define DEFAULT_DTIM_PERIOD 1
-
-#define AP_LONG_RETRY_LIMIT 4
-
-#define DEFAULT_IBSS_CHANNEL6  //2.4G
-
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Types  --*/
-#define timer_expire(timer, next_tick)   mod_timer(&timer, RUN_AT(next_tick))
-
-#endif // __WMGR_H__
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 48/48] staging: vt6655: dead code remove header type.h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/baseband.h   |  1 -
 drivers/staging/vt6655/card.h   |  1 -
 drivers/staging/vt6655/channel.h|  1 -
 drivers/staging/vt6655/desc.h   |  1 -
 drivers/staging/vt6655/device.h |  1 -
 drivers/staging/vt6655/device_cfg.h |  2 --
 drivers/staging/vt6655/key.h|  2 --
 drivers/staging/vt6655/mac.h|  1 -
 drivers/staging/vt6655/mib.h|  1 -
 drivers/staging/vt6655/power.c  |  1 -
 drivers/staging/vt6655/rf.h |  1 -
 drivers/staging/vt6655/rxtx.h   |  1 -
 drivers/staging/vt6655/srom.h   |  2 --
 drivers/staging/vt6655/tmacro.h |  2 --
 drivers/staging/vt6655/ttype.h  | 42 -
 drivers/staging/vt6655/upc.h|  1 -
 16 files changed, 61 deletions(-)
 delete mode 100644 drivers/staging/vt6655/ttype.h

diff --git a/drivers/staging/vt6655/baseband.h 
b/drivers/staging/vt6655/baseband.h
index 772ea0d..bfdd422 100644
--- a/drivers/staging/vt6655/baseband.h
+++ b/drivers/staging/vt6655/baseband.h
@@ -30,7 +30,6 @@
 #ifndef __BASEBAND_H__
 #define __BASEBAND_H__
 
-#include "ttype.h"
 #include "device.h"
 
 /*
diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
index 3a626a3..f5effdb 100644
--- a/drivers/staging/vt6655/card.h
+++ b/drivers/staging/vt6655/card.h
@@ -29,7 +29,6 @@
 #ifndef __CARD_H__
 #define __CARD_H__
 
-#include "ttype.h"
 #include 
 #include 
 
diff --git a/drivers/staging/vt6655/channel.h b/drivers/staging/vt6655/channel.h
index ee00f4e..4f4264e 100644
--- a/drivers/staging/vt6655/channel.h
+++ b/drivers/staging/vt6655/channel.h
@@ -23,7 +23,6 @@
 #ifndef _CHANNEL_H_
 #define _CHANNEL_H_
 
-#include "ttype.h"
 #include "card.h"
 
 void vnt_init_bands(struct vnt_private *);
diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
index 32dd1ca..758eeb2 100644
--- a/drivers/staging/vt6655/desc.h
+++ b/drivers/staging/vt6655/desc.h
@@ -34,7 +34,6 @@
 #include 
 #include 
 #include "linux/ieee80211.h"
-#include "ttype.h"
 
 #define B_OWNED_BY_CHIP 1
 #define B_OWNED_BY_HOST 0
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index d0855bd..93d2ccb 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -67,7 +67,6 @@
 /* device specific */
 
 #include "device_cfg.h"
-#include "ttype.h"
 #include "card.h"
 #include "mib.h"
 #include "srom.h"
diff --git a/drivers/staging/vt6655/device_cfg.h 
b/drivers/staging/vt6655/device_cfg.h
index 7221824..a4a8a84 100644
--- a/drivers/staging/vt6655/device_cfg.h
+++ b/drivers/staging/vt6655/device_cfg.h
@@ -29,8 +29,6 @@
 
 #include 
 
-#include "ttype.h"
-
 typedef
 struct _version {
unsigned char   major;
diff --git a/drivers/staging/vt6655/key.h b/drivers/staging/vt6655/key.h
index 5615f39..c01d4af 100644
--- a/drivers/staging/vt6655/key.h
+++ b/drivers/staging/vt6655/key.h
@@ -32,8 +32,6 @@
 
 #include 
 
-#include "ttype.h"
-
 /*-  Export Definitions -*/
 #define MAX_GROUP_KEY   4
 #define MAX_KEY_TABLE   11
diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 0bf9375..5391277 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -34,7 +34,6 @@
 #ifndef __MAC_H__
 #define __MAC_H__
 
-#include "ttype.h"
 #include "tmacro.h"
 #include "upc.h"
 
diff --git a/drivers/staging/vt6655/mib.h b/drivers/staging/vt6655/mib.h
index a2e6106..5cb59b8 100644
--- a/drivers/staging/vt6655/mib.h
+++ b/drivers/staging/vt6655/mib.h
@@ -29,7 +29,6 @@
 #ifndef __MIB_H__
 #define __MIB_H__
 
-#include "ttype.h"
 #include "desc.h"
 
 //
diff --git a/drivers/staging/vt6655/power.c b/drivers/staging/vt6655/power.c
index a8aedee..e826f07 100644
--- a/drivers/staging/vt6655/power.c
+++ b/drivers/staging/vt6655/power.c
@@ -37,7 +37,6 @@
  *
  */
 
-#include "ttype.h"
 #include "mac.h"
 #include "device.h"
 #include "power.h"
diff --git a/drivers/staging/vt6655/rf.h b/drivers/staging/vt6655/rf.h
index be4ef88..e8a7372 100644
--- a/drivers/staging/vt6655/rf.h
+++ b/drivers/staging/vt6655/rf.h
@@ -30,7 +30,6 @@
 #ifndef __RF_H__
 #define __RF_H__
 
-#include "ttype.h"
 #include "device.h"
 
 /*-  Export Definitions -*/
diff --git a/drivers/staging/vt6655/rxtx.h b/drivers/staging/vt6655/rxtx.h
index cf0dfa6..b9bd163 100644
--- a/drivers/staging/vt6655/rxtx.h
+++ b/drivers/staging/vt6655/rxtx.h
@@ -29,7 +29,6 @@
 #ifndef __RXTX_H__
 #define __RXTX_H__
 
-#include "ttype.h"
 #include "device.h"
 
 #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 /* 64us */
diff --git a/drivers/staging/vt6655/srom.h b/drivers/staging/vt6655/srom.h
index 3128e53..9f309c4 100644
--- a/drivers/staging/vt6655/srom.h
+++ b/drivers/staging/vt6655/srom.h
@@ -30,8 +30,6 @@
 #ifndef __SROM_H__
 #define __SROM_H__
 
-#include "ttype.h"
-
 /*-  Export Definitions -*

[PATCH v2 44/48] staging: vt6655: remove typedef void *TimerFunction

2014-10-29 Thread Malcolm Priestley
Covert functions TimerSQ3CallBack and TimerState1CallBack to
the correct type for struct timer_list.function to remove
the cast altogether.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/baseband.c| 8 
 drivers/staging/vt6655/baseband.h| 4 ++--
 drivers/staging/vt6655/device_main.c | 6 +++---
 drivers/staging/vt6655/wmgr.h| 1 -
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/vt6655/baseband.c 
b/drivers/staging/vt6655/baseband.c
index ed78505..b04dfd9 100644
--- a/drivers/staging/vt6655/baseband.c
+++ b/drivers/staging/vt6655/baseband.c
@@ -2781,10 +2781,10 @@ void BBvAntennaDiversity(struct vnt_private *pDevice,
 
 void
 TimerSQ3CallBack(
-   void *hDeviceContext
+   unsigned long data
 )
 {
-   struct vnt_private *pDevice = hDeviceContext;
+   struct vnt_private *pDevice = (struct vnt_private *)data;
unsigned long flags;
 
pr_debug("TimerSQ3CallBack...\n");
@@ -2827,10 +2827,10 @@ TimerSQ3CallBack(
 
 void
 TimerState1CallBack(
-   void *hDeviceContext
+   unsigned long data
 )
 {
-   struct vnt_private *pDevice = hDeviceContext;
+   struct vnt_private *pDevice = (struct vnt_private *)data;
unsigned long flags;
 
pr_debug("TimerState1CallBack...\n");
diff --git a/drivers/staging/vt6655/baseband.h 
b/drivers/staging/vt6655/baseband.h
index 2d7a3e2..772ea0d 100644
--- a/drivers/staging/vt6655/baseband.h
+++ b/drivers/staging/vt6655/baseband.h
@@ -103,12 +103,12 @@ void BBvExitDeepSleep(void __iomem *dwIoBase, unsigned 
char byLocalID);
 
 void
 TimerSQ3CallBack(
-   void *hDeviceContext
+   unsigned long
 );
 
 void
 TimerState1CallBack(
-   void *hDeviceContext
+   unsigned long
 );
 
 void BBvAntennaDiversity(struct vnt_private *pDevice,
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 7892f86..5c91c2f 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -625,17 +625,17 @@ static void device_init_diversity_timer(struct 
vnt_private *pDevice)
 {
init_timer(&pDevice->TimerSQ3Tmax1);
pDevice->TimerSQ3Tmax1.data = (unsigned long) pDevice;
-   pDevice->TimerSQ3Tmax1.function = (TimerFunction)TimerSQ3CallBack;
+   pDevice->TimerSQ3Tmax1.function = TimerSQ3CallBack;
pDevice->TimerSQ3Tmax1.expires = RUN_AT(HZ);
 
init_timer(&pDevice->TimerSQ3Tmax2);
pDevice->TimerSQ3Tmax2.data = (unsigned long) pDevice;
-   pDevice->TimerSQ3Tmax2.function = (TimerFunction)TimerSQ3CallBack;
+   pDevice->TimerSQ3Tmax2.function = TimerSQ3CallBack;
pDevice->TimerSQ3Tmax2.expires = RUN_AT(HZ);
 
init_timer(&pDevice->TimerSQ3Tmax3);
pDevice->TimerSQ3Tmax3.data = (unsigned long) pDevice;
-   pDevice->TimerSQ3Tmax3.function = (TimerFunction)TimerState1CallBack;
+   pDevice->TimerSQ3Tmax3.function = TimerState1CallBack;
pDevice->TimerSQ3Tmax3.expires = RUN_AT(HZ);
 }
 
diff --git a/drivers/staging/vt6655/wmgr.h b/drivers/staging/vt6655/wmgr.h
index 8f9748b..74f1f16 100644
--- a/drivers/staging/vt6655/wmgr.h
+++ b/drivers/staging/vt6655/wmgr.h
@@ -72,6 +72,5 @@
 
 /*-  Export Types  --*/
 #define timer_expire(timer, next_tick)   mod_timer(&timer, RUN_AT(next_tick))
-typedef void (*TimerFunction)(unsigned long);
 
 #endif // __WMGR_H__
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 40/48] staging: vt6655: dead code remove country.h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/channel.c |   1 -
 drivers/staging/vt6655/country.h | 161 ---
 2 files changed, 162 deletions(-)
 delete mode 100644 drivers/staging/vt6655/country.h

diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c
index 41146eb..6bd5f16 100644
--- a/drivers/staging/vt6655/channel.c
+++ b/drivers/staging/vt6655/channel.c
@@ -21,7 +21,6 @@
  */
 
 #include "baseband.h"
-#include "country.h"
 #include "channel.h"
 #include "device.h"
 #include "rf.h"
diff --git a/drivers/staging/vt6655/country.h b/drivers/staging/vt6655/country.h
deleted file mode 100644
index 2365fb1..000
--- a/drivers/staging/vt6655/country.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: country.h
- *
- * Purpose: Country Code information
- *
- * Author: Lucas Lin
- *
- * Date: Dec 23, 2004
- *
- */
-
-#ifndef __COUNTRY_H__
-#define __COUNTRY_H__
-
-#include "ttype.h"
-
-/
- * The definition here should be complied with the INF country order
- * Please check with VNWL.inf/VNWL64.inf/VNWL*.inf
- /
-typedef enum _COUNTRY_CODE {
-   CCODE_FCC = 0,
-   CCODE_TELEC,
-   CCODE_ETSI,
-   CCODE_RESV3,
-   CCODE_RESV4,
-   CCODE_RESV5,
-   CCODE_RESV6,
-   CCODE_RESV7,
-   CCODE_RESV8,
-   CCODE_RESV9,
-   CCODE_RESVa,
-   CCODE_RESVb,
-   CCODE_RESVc,
-   CCODE_RESVd,
-   CCODE_RESVe,
-   CCODE_ALLBAND,
-   CCODE_ALBANIA,
-   CCODE_ALGERIA,
-   CCODE_ARGENTINA,
-   CCODE_ARMENIA,
-   CCODE_AUSTRALIA,
-   CCODE_AUSTRIA,
-   CCODE_AZERBAIJAN,
-   CCODE_BAHRAIN,
-   CCODE_BELARUS,
-   CCODE_BELGIUM,
-   CCODE_BELIZE,
-   CCODE_BOLIVIA,
-   CCODE_BRAZIL,
-   CCODE_BRUNEI_DARUSSALAM,
-   CCODE_BULGARIA,
-   CCODE_CANADA,
-   CCODE_CHILE,
-   CCODE_CHINA,
-   CCODE_COLOMBIA,
-   CCODE_COSTA_RICA,
-   CCODE_CROATIA,
-   CCODE_CYPRUS,
-   CCODE_CZECH,
-   CCODE_DENMARK,
-   CCODE_DOMINICAN_REPUBLIC,
-   CCODE_ECUADOR,
-   CCODE_EGYPT,
-   CCODE_EL_SALVADOR,
-   CCODE_ESTONIA,
-   CCODE_FINLAND,
-   CCODE_FRANCE,
-   CCODE_GERMANY,
-   CCODE_GREECE,
-   CCODE_GEORGIA,
-   CCODE_GUATEMALA,
-   CCODE_HONDURAS,
-   CCODE_HONG_KONG,
-   CCODE_HUNGARY,
-   CCODE_ICELAND,
-   CCODE_INDIA,
-   CCODE_INDONESIA,
-   CCODE_IRAN,
-   CCODE_IRELAND,
-   CCODE_ITALY,
-   CCODE_ISRAEL,
-   CCODE_JAPAN,
-   CCODE_JORDAN,
-   CCODE_KAZAKHSTAN,
-   CCODE_KUWAIT,
-   CCODE_LATVIA,
-   CCODE_LEBANON,
-   CCODE_LEICHTENSTEIN,
-   CCODE_LITHUANIA,
-   CCODE_LUXEMBURG,
-   CCODE_MACAU,
-   CCODE_MACEDONIA,
-   CCODE_MALTA,
-   CCODE_MALAYSIA,
-   CCODE_MEXICO,
-   CCODE_MONACO,
-   CCODE_MOROCCO,
-   CCODE_NETHERLANDS,
-   CCODE_NEW_ZEALAND,
-   CCODE_NORTH_KOREA,
-   CCODE_NORWAY,
-   CCODE_OMAN,
-   CCODE_PAKISTAN,
-   CCODE_PANAMA,
-   CCODE_PERU,
-   CCODE_PHILIPPINES,
-   CCODE_POLAND,
-   CCODE_PORTUGAL,
-   CCODE_PUERTO_RICO,
-   CCODE_QATAR,
-   CCODE_ROMANIA,
-   CCODE_RUSSIA,
-   CCODE_SAUDI_ARABIA,
-   CCODE_SINGAPORE,
-   CCODE_SLOVAKIA,
-   CCODE_SLOVENIA,
-   CCODE_SOUTH_AFRICA,
-   CCODE_SOUTH_KOREA,
-   CCODE_SPAIN,
-   CCODE_SWEDEN,
-   CCODE_SWITZERLAND,
-   CCODE_SYRIA,
-   CCODE_TAIWAN,
-   CCODE_THAILAND,
-   CCODE_TRINIDAD_TOBAGO,
-   CCODE_TUNISIA,
-   CCODE_TURKEY,
-   CCODE_UK,
-   CCODE_UKRAINE,
-   CCODE_UNITED_ARAB_EMIRATES,
-   CCODE_UNITED_STATES,
-   CCODE_URUGUAY,
-   CCODE_UZBEKISTAN,
-   CCODE_VENEZUELA,
-   CCODE_VIETNAM,
-   CCODE_YEMEN,
-   CCODE_ZIMBABWE,
-   CCODE_JAPAN_W52_W53,
-   CCODE_MAX
-} COUNTRY_CODE;
-
-#endif  /* __COUNTRY_H__ */
-- 
2.1.0

--
To unsubscribe from this list: send the line "un

[PATCH v2 45/48] staging: vt6655: Move LIFETIME RES 64us macros to rxtx.h

2014-10-29 Thread Malcolm Priestley
Used only by vnt_generate_fifo_header move these macros.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/rxtx.h | 4 
 drivers/staging/vt6655/wmgr.h | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.h b/drivers/staging/vt6655/rxtx.h
index 50d77a0..cf0dfa6 100644
--- a/drivers/staging/vt6655/rxtx.h
+++ b/drivers/staging/vt6655/rxtx.h
@@ -32,6 +32,10 @@
 #include "ttype.h"
 #include "device.h"
 
+#define DEFAULT_MSDU_LIFETIME_RES_64us 8000 /* 64us */
+#define DEFAULT_MGN_LIFETIME_RES_64us  125  /* 64us */
+
+
 /*-  Export Definitions -*/
 
 /*-  Export Variables  --*/
diff --git a/drivers/staging/vt6655/wmgr.h b/drivers/staging/vt6655/wmgr.h
index 74f1f16..daf996c 100644
--- a/drivers/staging/vt6655/wmgr.h
+++ b/drivers/staging/vt6655/wmgr.h
@@ -51,10 +51,8 @@
 #define WCMD_PASSIVE_SCAN_TIME  100 //(ms)
 
 #define DEFAULT_MSDU_LIFETIME   512  // ms
-#define DEFAULT_MSDU_LIFETIME_RES_64us  8000 // 64us
 
 #define DEFAULT_MGN_LIFETIME8// ms
-#define DEFAULT_MGN_LIFETIME_RES_64us   125  // 64us
 
 #define MAKE_BEACON_RESERVED10  //(us)
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 33/48] staging: vt6655: dead code remove ndis and pmkid strutures.

2014-10-29 Thread Malcolm Priestley
struct pmkid_candidate
typedef struct _BSSID_INFO
typedef struct tagSPMKID
typedef struct tagSPMKIDCandidateEvent
NDIS_802_11_MAC_ADDRESS
typedef struct _NDIS_802_11_AI_REQFI
typedef struct _NDIS_802_11_AI_RESFI
typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION
typedef struct tagSAssocInfo

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h | 26 --
 drivers/staging/vt6655/wmgr.h   | 35 ---
 2 files changed, 61 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index d2779a3..0725d78 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -216,29 +216,6 @@ typedef enum _NDIS_802_11_STATUS_TYPE {
Ndis802_11StatusTypeMax/* defined as an upper bound */
 } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
 
-/* Added new types for PMKID Candidate lists. */
-struct pmkid_candidate {
-   NDIS_802_11_MAC_ADDRESS BSSID;
-   unsigned long Flags;
-};
-
-typedef struct _BSSID_INFO {
-   NDIS_802_11_MAC_ADDRESS BSSID;
-   NDIS_802_11_PMKID_VALUE PMKID;
-} BSSID_INFO, *PBSSID_INFO;
-
-typedef struct tagSPMKID {
-   unsigned long Length;
-   unsigned long BSSIDInfoCount;
-   BSSID_INFO BSSIDInfo[MAX_BSSIDINFO_4_PMKID];
-} SPMKID, *PSPMKID;
-
-typedef struct tagSPMKIDCandidateEvent {
-   NDIS_802_11_STATUS_TYPE StatusType;
-   unsigned long Version;   /* Version of the structure */
-   unsigned long NumCandidates; /* No. of pmkid candidates */
-   struct pmkid_candidate CandidateList[MAX_PMKIDLIST];
-} SPMKIDCandidateEvent, *PSPMKIDCandidateEvent;
 
 /* 802.11h related */
 #define MAX_QUIET_COUNT 8
@@ -667,9 +644,6 @@ struct vnt_private {
unsigned char abySNAP_RFC1042[ETH_ALEN];
unsigned char abySNAP_Bridgetunnel[ETH_ALEN];
unsigned char abyEEPROM[EEP_MAX_CONTEXT_SIZE]; /* unsigned long 
alignment */
-   /* Pre-Authentication & PMK cache */
-   SPMKID  gsPMKID;
-   SPMKIDCandidateEventgsPMKIDCandidate;
 
/* for 802.11h */
bool b11hEnable;
diff --git a/drivers/staging/vt6655/wmgr.h b/drivers/staging/vt6655/wmgr.h
index 1deedd8..cc8662e 100644
--- a/drivers/staging/vt6655/wmgr.h
+++ b/drivers/staging/vt6655/wmgr.h
@@ -78,39 +78,4 @@
 #define timer_expire(timer, next_tick)   mod_timer(&timer, RUN_AT(next_tick))
 typedef void (*TimerFunction)(unsigned long);
 
-//+++ NDIS related
-
-typedef unsigned char NDIS_802_11_MAC_ADDRESS[6];
-typedef struct _NDIS_802_11_AI_REQFI {
-   unsigned short Capabilities;
-   unsigned short ListenInterval;
-   NDIS_802_11_MAC_ADDRESS  CurrentAPAddress;
-} NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
-
-typedef struct _NDIS_802_11_AI_RESFI {
-   unsigned short Capabilities;
-   unsigned short StatusCode;
-   unsigned short AssociationId;
-} NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
-
-typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION {
-   unsigned long Length;
-   unsigned short  AvailableRequestFixedIEs;
-   NDIS_802_11_AI_REQFIRequestFixedIEs;
-   unsigned long RequestIELength;
-   unsigned long OffsetRequestIEs;
-   unsigned short  AvailableResponseFixedIEs;
-   NDIS_802_11_AI_RESFIResponseFixedIEs;
-   unsigned long ResponseIELength;
-   unsigned long OffsetResponseIEs;
-} NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
-
-typedef struct tagSAssocInfo {
-   NDIS_802_11_ASSOCIATION_INFORMATION AssocInfo;
-   unsigned char abyIEs[WLAN_BEACON_FR_MAXLEN+WLAN_BEACON_FR_MAXLEN];
-   // store ReqIEs set by OID_802_11_ASSOCIATION_INFORMATION
-   unsigned long RequestIELength;
-   unsigned char abyReqIEs[WLAN_BEACON_FR_MAXLEN];
-} SAssocInfo, *PSAssocInfo;
-
 #endif // __WMGR_H__
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 27/48] staging: vt6655: dead code remove 80211mgr.c and functions

2014-10-29 Thread Malcolm Priestley
80211mgr.h header will be removed later

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/80211mgr.c | 1006 -
 drivers/staging/vt6655/80211mgr.h |  110 
 drivers/staging/vt6655/Makefile   |1 -
 3 files changed, 1117 deletions(-)
 delete mode 100644 drivers/staging/vt6655/80211mgr.c

diff --git a/drivers/staging/vt6655/80211mgr.c 
b/drivers/staging/vt6655/80211mgr.c
deleted file mode 100644
index 22ded38..000
--- a/drivers/staging/vt6655/80211mgr.c
+++ /dev/null
@@ -1,1006 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: 80211mgr.c
- *
- * Purpose: Handles the 802.11 management support functions
- *
- * Author: Lyndon Chen
- *
- * Date: May 8, 2002
- *
- * Functions:
- *  vMgrEncodeBeacon - Encode the Beacon frame
- *  vMgrDecodeBeacon - Decode the Beacon frame
- *  vMgrEncodeIBSSATIM - Encode the IBSS ATIM frame
- *  vMgrDecodeIBSSATIM - Decode the IBSS ATIM frame
- *  vMgrEncodeDisassociation - Encode the Disassociation frame
- *  vMgrDecodeDisassociation - Decode the Disassociation frame
- *  vMgrEncodeAssocRequest - Encode the Association request frame
- *  vMgrDecodeAssocRequest - Decode the Association request frame
- *  vMgrEncodeAssocResponse - Encode the Association response frame
- *  vMgrDecodeAssocResponse - Decode the Association response frame
- *  vMgrEncodeReAssocRequest - Encode the ReAssociation request frame
- *  vMgrDecodeReAssocRequest - Decode the ReAssociation request frame
- *  vMgrEncodeProbeRequest - Encode the Probe request frame
- *  vMgrDecodeProbeRequest - Decode the Probe request frame
- *  vMgrEncodeProbeResponse - Encode the Probe response frame
- *  vMgrDecodeProbeResponse - Decode the Probe response frame
- *  vMgrEncodeAuthen - Encode the Authentication frame
- *  vMgrDecodeAuthen - Decode the Authentication frame
- *  vMgrEncodeDeauthen - Encode the DeAuthentication frame
- *  vMgrDecodeDeauthen - Decode the DeAuthentication frame
- *  vMgrEncodeReassocResponse - Encode the Reassociation response frame
- *  vMgrDecodeReassocResponse - Decode the Reassociation response frame
- *
- * Revision History:
- *
- */
-
-#include "tmacro.h"
-#include "tether.h"
-#include "80211mgr.h"
-#include "80211hdr.h"
-#include "device.h"
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Functions  --*/
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
-/*+
- *
- * Routine Description:
- * Encode Beacon frame body offset
- *
- * Return Value:
- *None.
- *
- -*/
-
-void
-vMgrEncodeBeacon(
-   PWLAN_FR_BEACON  pFrame
-)
-{
-   pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
-
-   /* Fixed Fields */
-   pFrame->pqwTimestamp = (__le64 *)
-   (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
-WLAN_BEACON_OFF_TS);
-   pFrame->pwBeaconInterval = (unsigned short *)
-   (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
-WLAN_BEACON_OFF_BCN_INT);
-   pFrame->pwCapInfo = (unsigned short *)
-   (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
-WLAN_BEACON_OFF_CAPINFO);
-
-   pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_BEACON_OFF_SSID;
-}
-
-/*+
- *
- * Routine Description:
- * Decode Beacon frame body offset
- *
- *
- * Return Value:
- *None.
- *
- -*/
-
-void
-vMgrDecodeBeacon(
-   PWLAN_FR_BEACON  pFrame
-)
-{
-   PWLAN_IEpItem;
-
-   pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
-
-   /* Fixed Fields */
-   pFrame->pqwTimestamp = (__le64 *)
-   (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
-WLAN_BEACON_OFF_TS);
-   pFrame->pwBeaconInterval = (unsigned short *)
-  (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) 

[PATCH v2 35/48] staging: vt6655: dead code remove bssdb.h header

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/bssdb.h   | 210 ---
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/rxtx.c|   1 -
 drivers/staging/vt6655/wmgr.h|   1 -
 4 files changed, 213 deletions(-)
 delete mode 100644 drivers/staging/vt6655/bssdb.h

diff --git a/drivers/staging/vt6655/bssdb.h b/drivers/staging/vt6655/bssdb.h
deleted file mode 100644
index 511b7f9..000
--- a/drivers/staging/vt6655/bssdb.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: bssdb.h
- *
- * Purpose: Handles the Basic Service Set & Node Database functions
- *
- * Author: Lyndon Chen
- *
- * Date: July 16, 2002
- *
- */
-
-#ifndef __BSSDB_H__
-#define __BSSDB_H__
-
-#include 
-#include "80211hdr.h"
-#include "80211mgr.h"
-#include "card.h"
-
-#define MAX_NODE_NUM 64
-#define MAX_BSS_NUM  42
-#define LOST_BEACON_COUNT10   /* 10 sec, XP defined */
-#define MAX_PS_TX_BUF32   /* sta max power saving tx buf */
-#define ADHOC_LOST_BEACON_COUNT  30   /* 30 sec, beacon lost for adhoc only */
-#define MAX_INACTIVE_COUNT   300  /* 300 sec, inactive STA node refresh */
-
-#define USE_PROTECT_PERIOD   10   /*10 sec, Use protect mode check period*/
-#define ERP_RECOVER_COUNT30   /* 30 sec, ERP support callback check */
-#define BSS_CLEAR_COUNT   1
-
-#define RSSI_STAT_COUNT  10
-#define MAX_CHECK_RSSI_COUNT 8
-
-/* STA dwflags */
-#define WLAN_STA_AUTHBIT0
-#define WLAN_STA_ASSOC   BIT1
-#define WLAN_STA_PS  BIT2
-#define WLAN_STA_TIM BIT3
-/* permanent; do not remove entry on expiration */
-#define WLAN_STA_PERMBIT4
-/*
- * If 802.1X is used, this flag is controlling whether STA is authorized
- * to send and receive non-IEEE 802.1X frames
- */
-#define WLAN_STA_AUTHORIZED  BIT5
-
-#define MAX_RATE12
-
-#define MAX_WPA_IE_LEN  64
-
-/* IEEE 802.11 Structures and definitions */
-
-typedef enum _NDIS_802_11_NETWORK_TYPE {
-   Ndis802_11FH,
-   Ndis802_11DS,
-   Ndis802_11OFDM5,
-   Ndis802_11OFDM24,
-   Ndis802_11NetworkTypeMax/* defined as an upper bound */
-} NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
-
-typedef struct tagSERPObject {
-   bool bERPExist;
-   unsigned char byERP;
-} ERPObject, *PERPObject;
-
-typedef struct tagSRSNCapObject {
-   bool bRSNCapExist;
-   unsigned short wRSNCap;
-} SRSNCapObject, *PSRSNCapObject;
-
-/* BSS info(AP) */
-#pragma pack(1)
-typedef struct tagKnownBSS {
-   bool bActive;
-   unsigned char abyBSSID[WLAN_BSSID_LEN];
-   unsigned intuChannel;
-   unsigned char abySuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1];
-   unsigned char abyExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1];
-   unsigned intuRSSI;
-   unsigned char bySQ;
-   unsigned short wBeaconInterval;
-   unsigned short wCapInfo;
-   unsigned char abySSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
-   unsigned char byRxRate;
-
-   unsigned char byRSSIStatCnt;
-   longldBmMAX;
-   longldBmAverage[RSSI_STAT_COUNT];
-   longldBmAverRange;
-   bool bSelected;
-
-   bool bWPAValid;
-   unsigned char byGKType;
-   unsigned char abyPKType[4];
-   unsigned short wPKCount;
-   unsigned char abyAuthType[4];
-   unsigned short wAuthCount;
-   unsigned char byDefaultK_as_PK;
-   unsigned char byReplayIdx;
-
-   bool bWPA2Valid;
-   unsigned char byCSSGK;
-   unsigned short wCSSPKCount;
-   unsigned char abyCSSPK[4];
-   unsigned short wAKMSSAuthCount;
-   unsigned char abyAKMSSAuthType[4];
-
-   unsigned char byWPAIE[MAX_WPA_IE_LEN];
-   unsigned char byRSNIE[MAX_WPA_IE_LEN];
-   unsigned short wWPALen;
-   unsigned short wRSNLen;
-
-   unsigned intuClearCount;
-   unsigned intuIELength;
-   u64 qwBSSTimestamp;
-   u64 qwLocalTSF;
-
-   CARD_PHY_TYPE   eNetworkTypeInUse;
-
-   ERPObject   sERP;
-   SRSNCapObject   sRSNCapObj;
-  

[PATCH v2 05/48] staging: vt6655: dead code remove ioctl.c/h

2014-10-29 Thread Malcolm Priestley
The driver nolonger supports these io functions

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |   1 -
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/ioctl.c   | 582 ---
 drivers/staging/vt6655/ioctl.h   |  36 ---
 4 files changed, 620 deletions(-)
 delete mode 100644 drivers/staging/vt6655/ioctl.c
 delete mode 100644 drivers/staging/vt6655/ioctl.h

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 455f088..6e93499 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -21,7 +21,6 @@ vt6655_stage-y += device_main.o \
rc4.o \
tether.o \
tcrc.o \
-   ioctl.o \
hostap.o \
wpa.o \
key.o \
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 51b20f3..5b54cab 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -70,7 +70,6 @@
 #include "bssdb.h"
 #include "hostap.h"
 #include "wpactl.h"
-#include "ioctl.h"
 #include "dpc.h"
 #include "datarate.h"
 #include "rf.h"
diff --git a/drivers/staging/vt6655/ioctl.c b/drivers/staging/vt6655/ioctl.c
deleted file mode 100644
index c2b6763..000
--- a/drivers/staging/vt6655/ioctl.c
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: ioctl.c
- *
- * Purpose:  private ioctl functions
- *
- * Author: Lyndon Chen
- *
- * Date: Auguest 20, 2003
- *
- * Functions:
- *
- * Revision History:
- *
- */
-
-#include "ioctl.h"
-#include "iocmd.h"
-#include "mac.h"
-#include "card.h"
-#include "hostap.h"
-#include "wpactl.h"
-#include "rf.h"
-
-int private_ioctl(struct vnt_private *pDevice, struct ifreq *rq)
-{
-   PSCmdRequestpReq = (PSCmdRequest)rq;
-   PSMgmtObjectpMgmt = pDevice->pMgmt;
-   int result = 0;
-   PWLAN_IE_SSID   pItemSSID;
-   SCmdBSSJoin sJoinCmd;
-   SCmdScansScanCmd;
-   SCmdStartAP sStartAPCmd;
-   SCmdSetWEP  sWEPCmd;
-   SCmdValue   sValue;
-   SBSSIDList  sList;
-   SNodeList   sNodeList;
-   PSBSSIDList pList;
-   PSNodeList  pNodeList;
-   unsigned intcbListCount;
-   PKnownBSS   pBSS;
-   PKnownNodeDBpNode;
-   unsigned intii, jj;
-   unsigned char   abySuppRates[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 
0x0B, 0x16};
-   unsigned char   abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-   unsigned long   dwKeyIndex = 0;
-   unsigned char   abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
-   longldBm;
-
-   pReq->wResult = 0;
-
-   switch (pReq->wCmdCode) {
-   case WLAN_CMD_BSS_SCAN:
-   pr_debug("WLAN_CMD_BSS_SCAN..begin\n");
-   if (copy_from_user(&sScanCmd, pReq->data, sizeof(SCmdScan))) {
-   result = -EFAULT;
-   break;
-   }
-
-   pItemSSID = (PWLAN_IE_SSID)sScanCmd.ssid;
-   if (pItemSSID->len > WLAN_SSID_MAXLEN + 1)
-   return -EINVAL;
-   if (pItemSSID->len != 0) {
-   memset(abyScanSSID, 0, WLAN_IEHDR_LEN + 
WLAN_SSID_MAXLEN + 1);
-   memcpy(abyScanSSID, pItemSSID, pItemSSID->len + 
WLAN_IEHDR_LEN);
-   }
-
-   if (pDevice->bMACSuspend == true) {
-   if (pDevice->bRadioOff == true)
-   CARDbRadioPowerOn(pDevice);
-   vMgrTimerInit(pDevice);
-   MACvIntEnable(pDevice->PortOffset, IMR_MASK_VALUE);
-   add_timer(&pMgmt->sTimerSecondCallback);
-   pDevice->bMACSuspend = false;
-   }
-   spin_lock_irq(&pDevice->lock);
-   if (memcmp(pMgmt->abyCurrBSSID, &abyNullAddr[0], 6) == 0)
-   BSSvClearBSSList((void *)pDevice, false);
-   else
-   BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass);
-
-   if (pItemSSID->len != 0)
-   

[PATCH v2 34/48] staging: vt6655: dead remove wcmd.h and typedefs

2014-10-29 Thread Malcolm Priestley
CMD_STATE
CMD_CODE
CMD_ITEM

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h  |  5 --
 drivers/staging/vt6655/device_main.c |  1 -
 drivers/staging/vt6655/power.c   |  1 -
 drivers/staging/vt6655/rxtx.h|  1 -
 drivers/staging/vt6655/wcmd.h| 91 
 drivers/staging/vt6655/wmgr.h|  1 -
 6 files changed, 100 deletions(-)
 delete mode 100644 drivers/staging/vt6655/wcmd.h

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 0725d78..f73239f 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -71,7 +71,6 @@
 #include "80211hdr.h"
 #include "tether.h"
 #include "wmgr.h"
-#include "wcmd.h"
 #include "mib.h"
 #include "srom.h"
 #include "desc.h"
@@ -498,9 +497,6 @@ struct vnt_private {
unsigned char byCurrentCh;
unsigned intuScanTime;
 
-   CMD_STATE   eCommandState;
-
-   CMD_CODEeCommand;
bool bBeaconTx;
 
bool bStopBeacon;
@@ -510,7 +506,6 @@ struct vnt_private {
 
/* 802.11 counter */
 
-   CMD_ITEMeCmdQueue[CMD_Q_SIZE];
unsigned intuCmdDequeueIdx;
unsigned intuCmdEnqueueIdx;
unsigned intcbFreeCmdQueue;
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index d8fd44c..80bbe1d 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -61,7 +61,6 @@
 #include "tether.h"
 #include "wmgr.h"
 #include "power.h"
-#include "wcmd.h"
 #include "iocmd.h"
 #include "rxtx.h"
 #include "bssdb.h"
diff --git a/drivers/staging/vt6655/power.c b/drivers/staging/vt6655/power.c
index 040484e..6f83650 100644
--- a/drivers/staging/vt6655/power.c
+++ b/drivers/staging/vt6655/power.c
@@ -42,7 +42,6 @@
 #include "device.h"
 #include "wmgr.h"
 #include "power.h"
-#include "wcmd.h"
 #include "card.h"
 
 /*-  Static Definitions -*/
diff --git a/drivers/staging/vt6655/rxtx.h b/drivers/staging/vt6655/rxtx.h
index 7b0566c..50d77a0 100644
--- a/drivers/staging/vt6655/rxtx.h
+++ b/drivers/staging/vt6655/rxtx.h
@@ -31,7 +31,6 @@
 
 #include "ttype.h"
 #include "device.h"
-#include "wcmd.h"
 
 /*-  Export Definitions -*/
 
diff --git a/drivers/staging/vt6655/wcmd.h b/drivers/staging/vt6655/wcmd.h
deleted file mode 100644
index ae7ddea..000
--- a/drivers/staging/vt6655/wcmd.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: wcmd.h
- *
- * Purpose: Handles the management command interface functions
- *
- * Author: Lyndon Chen
- *
- * Date: May 8, 2002
- *
- */
-
-#ifndef __WCMD_H__
-#define __WCMD_H__
-
-#include "ttype.h"
-#include "80211hdr.h"
-#include "80211mgr.h"
-
-#define AUTHENTICATE_TIMEOUT   1000
-#define ASSOCIATE_TIMEOUT  1000
-
-typedef enum tagCMD_CODE {
-   WLAN_CMD_BSSID_SCAN,
-   WLAN_CMD_SSID,
-   WLAN_CMD_DISASSOCIATE,
-   WLAN_CMD_DEAUTH,
-   WLAN_CMD_RX_PSPOLL,
-   WLAN_CMD_RADIO,
-   WLAN_CMD_CHANGE_BBSENSITIVITY,
-   WLAN_CMD_SETPOWER,
-   WLAN_CMD_TBTT_WAKEUP,
-   WLAN_CMD_BECON_SEND,
-   WLAN_CMD_CHANGE_ANTENNA,
-   WLAN_CMD_REMOVE_ALLKEY,
-   WLAN_CMD_MAC_DISPOWERSAVING,
-   WLAN_CMD_11H_CHSW,
-   WLAN_CMD_RUN_AP
-} CMD_CODE, *PCMD_CODE;
-
-#define CMD_Q_SIZE  32
-
-typedef enum tagCMD_STATUS {
-   CMD_STATUS_SUCCESS = 0,
-   CMD_STATUS_FAILURE,
-   CMD_STATUS_RESOURCES,
-   CMD_STATUS_TIMEOUT,
-   CMD_STATUS_PENDING
-} CMD_STATUS, *PCMD_STATUS;
-
-typedef struct tagCMD_ITEM {
-   CMD_CODE eCmd;
-   unsigned char abyCmdDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
-   bool bNeedRadioOFF;
-   unsigned short wDeAuthenReason;
-   bool bRadioCmd;
-   bool bForceSCAN;
-} CMD_ITEM, *PCMD_ITEM;
-
-typedef enum tagCMD_STATE {
-   WLAN_CMD_SCAN_START,
-   WLAN_CMD_SCAN_END,
-   WLAN_CMD_DISASSOCIATE_START,
-   WLAN_CMD_SSID_START,
-   WLAN_AUTHENTICATE_WAIT,
-   WLAN_ASSOCIATE_WAIT,
-   WLAN_DISASSOCIATE_WAIT,
-   WLAN_

[PATCH v2 25/48] staging: vt6655L remove tether.c functions

2014-10-29 Thread Malcolm Priestley
remove
ETHbyGetHashIndexByCrc32
ETHbIsBufferCrc32Ok

tether.h header will be removed later

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile |   1 -
 drivers/staging/vt6655/tether.c | 105 
 drivers/staging/vt6655/tether.h |   4 --
 3 files changed, 110 deletions(-)
 delete mode 100644 drivers/staging/vt6655/tether.c

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index d571e6f..1a5876d 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -14,7 +14,6 @@ vt6655_stage-y += device_main.o \
power.o \
srom.o \
mib.o \
-   tether.o \
tcrc.o \
key.o \
rf.o
diff --git a/drivers/staging/vt6655/tether.c b/drivers/staging/vt6655/tether.c
deleted file mode 100644
index 1e7d3e2..000
--- a/drivers/staging/vt6655/tether.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2003 VIA Networking, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: tether.c
- *
- * Purpose:
- *
- * Author: Tevin Chen
- *
- * Date: May 21, 1996
- *
- * Functions:
- *  ETHbyGetHashIndexByCrc32 - Calculate multicast hash value by CRC32
- *  ETHbIsBufferCrc32Ok - Check CRC value of the buffer if Ok or not
- *
- * Revision History:
- *
- */
-
-#include "device.h"
-#include "tmacro.h"
-#include "tcrc.h"
-#include "tether.h"
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Variables  --*/
-
-/*-  Static Functions  --*/
-
-/*-  Export Variables  --*/
-
-/*
- * Description: Calculate multicast hash value by CRC32
- *
- * Parameters:
- *  In:
- * pbyMultiAddr- Multicast Address
- *  Out:
- *  none
- *
- * Return Value: Hash value
- *
- */
-unsigned char ETHbyGetHashIndexByCrc32(unsigned char *pbyMultiAddr)
-{
-   int ii;
-   unsigned char byTmpHash;
-   unsigned char byHash = 0;
-
-   // get the least 6-bits from CRC generator
-   byTmpHash = (unsigned char)(CRCdwCrc32(pbyMultiAddr, ETH_ALEN,
-  0xL) & 0x3F);
-   // reverse most bit to least bit
-   for (ii = 0; ii < (sizeof(byTmpHash) * 8); ii++) {
-   byHash <<= 1;
-   if (byTmpHash & 0x01)
-   byHash |= 1;
-   byTmpHash >>= 1;
-   }
-
-   // adjust 6-bits to the right most
-   return byHash >> 2;
-}
-
-/*
- * Description: Check CRC value of the buffer if Ok or not
- *
- * Parameters:
- *  In:
- * pbyBuffer   - pointer of buffer (normally is rx buffer)
- * cbFrameLength   - length of buffer, including CRC portion
- *  Out:
- *  none
- *
- * Return Value: true if ok; false if error.
- *
- */
-bool ETHbIsBufferCrc32Ok(unsigned char *pbyBuffer, unsigned int cbFrameLength)
-{
-   unsigned long dwCRC;
-
-   dwCRC = CRCdwGetCrc32(pbyBuffer, cbFrameLength - 4);
-   if (cpu_to_le32(*((unsigned long *)(pbyBuffer + cbFrameLength - 4))) != 
dwCRC)
-   return false;
-
-   return true;
-}
diff --git a/drivers/staging/vt6655/tether.h b/drivers/staging/vt6655/tether.h
index 94cc883..850554c 100644
--- a/drivers/staging/vt6655/tether.h
+++ b/drivers/staging/vt6655/tether.h
@@ -185,8 +185,4 @@ S802_11Header, *PS802_11Header;
 
 /*-  Export Functions  --*/
 
-unsigned char ETHbyGetHashIndexByCrc32(unsigned char *pbyMultiAddr);
-//unsigned char ETHbyGetHashIndexByCrc(unsigned char *pbyMultiAddr);
-bool ETHbIsBufferCrc32Ok(unsigned char *pbyBuffer, unsigned int cbFrameLength);
-
 #endif // __TETHER_H__
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 29/48] staging: vt6655: channel.c remove dead functions

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/channel.c | 113 ---
 drivers/staging/vt6655/channel.h |  13 -
 2 files changed, 126 deletions(-)

diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c
index a7b39d4..41146eb 100644
--- a/drivers/staging/vt6655/channel.c
+++ b/drivers/staging/vt6655/channel.c
@@ -167,66 +167,6 @@ void vnt_init_bands(struct vnt_private *priv)
 }
 
 /**
- * is_channel_valid() - Is Country Channel Valid
- *  @ChanneIndex: defined as VT3253 MAC channel:
- *  1   = 2.4G channel 1
- *  2   = 2.4G channel 2
- *  ...
- *  14  = 2.4G channel 14
- *  15  = 4.9G channel 183
- *  16  = 4.9G channel 184
- *  .
- *  Output: true if the specified 5GHz band is allowed to be used,
- *  false otherwise.
- * 4.9G => Ch 183, 184, 185, 187, 188, 189, 192, 196 (Value:15 ~ 22)
- *
- * 5G => Ch 7, 8, 9, 11, 12, 16, 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 
64,
- * 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 
165 (Value 23 ~ 56)
- */
-
-bool is_channel_valid(unsigned int ChannelIndex)
-{
-   bool bValid;
-
-   bValid = false;
-   /* If Channel Index is invalid, return invalid */
-   if ((ChannelIndex > CB_MAX_CHANNEL) ||
-   (ChannelIndex == 0)) {
-   bValid = false;
-   goto exit;
-   }
-exit:
-   return bValid;
-}
-
-/**
- * channel_get_list() - Get Available Channel List for a given country
- * @CountryCode: The country code defined in country.h
- *
- * Output:
- *  pbyChannelTable:   (QWORD *) correspondent bit mask
- *  of available channels
- *  0x0001 means channel 1 is supported
- *  0x0003 means channel 1,2 are supported
- *  0x000F means channel 1,2,..15 are 
supported
- */
-
-bool channel_get_list(unsigned int uCountryCodeIdx, unsigned char 
*pbyChannelTable)
-{
-   return true;
-}
-
-unsigned char get_channel_mapping(void *pDeviceHandler, unsigned char 
byChannelNumber, CARD_PHY_TYPE ePhyType)
-{
-   return 0;
-}
-
-unsigned char get_channel_number(void *pDeviceHandler, unsigned char 
byChannelIndex)
-{
-   return 0;
-}
-
-/**
  * set_channel() - Set NIC media channel
  *
  * @pDeviceHandler: The adapter to be set
@@ -277,56 +217,3 @@ bool set_channel(void *pDeviceHandler, unsigned int 
uConnectionChannel)
 
return bResult;
 }
-
-/**
- * set_country_info() - Set Channel Info of Country
- *
- * Return Value: none.
- *
- */
-
-void set_country_info(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, void *pIE)
-{
-}
-
-/**
- *
- * set_support_channels() - Set Support Channels IE defined in 802.11h
- *
- * @hDeviceContext: device structure point
- *
- * Return Value: none.
- *
- */
-
-unsigned char set_support_channels(void *pDeviceHandler, unsigned char *pbyIEs)
-{
-   unsigned char byLen = 0;
-   return byLen;
-}
-
-void set_country_IE(void *pDeviceHandler, void *pIE)
-{
-}
-
-bool get_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex,
- unsigned char *pbyChannelNumber, unsigned char 
*pbyMap)
-{
-   return 0;
-}
-
-void set_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex,
- unsigned char byMap)
-{
-}
-
-void clear_channel_map_info(void *pDeviceHandler)
-{
-
-}
-
-unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
-{
-   unsigned char byOptionChannel = 0;
-   return byOptionChannel;
-}
diff --git a/drivers/staging/vt6655/channel.h b/drivers/staging/vt6655/channel.h
index 78ab642..ee00f4e 100644
--- a/drivers/staging/vt6655/channel.h
+++ b/drivers/staging/vt6655/channel.h
@@ -28,19 +28,6 @@
 
 void vnt_init_bands(struct vnt_private *);
 
-bool is_channel_valid(unsigned int CountryCode);
-unsigned char get_channel_mapping(void *pDeviceHandler, unsigned char 
byChannelNumber, CARD_PHY_TYPE ePhyType);
-bool channel_get_list(unsigned int uCountryCodeIdx, unsigned char 
*pbyChannelTable);
-unsigned char get_channel_number(void *pDeviceHandler, unsigned char 
byChannelIndex);
 bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel);
-void set_country_info(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, void *pIE);
-unsigned char set_support_channels(void *pDeviceHandler, unsigned char 
*pbyIEs);
-void set_country_IE(void *pDeviceHandler, void *pIE);
-bool get_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex,
- unsigned char *pbyChannelNumber, unsigned char 
*pbyMap);
-void set_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex,
- unsigned char byMap);
-void clear_channel_map_info(void *pDeviceHandler);
-unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY

[PATCH v2 28/48] staging: vt6655: dead code remove wctl.c/h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |   1 -
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/rxtx.c|   1 -
 drivers/staging/vt6655/wctl.c| 233 ---
 drivers/staging/vt6655/wctl.h| 105 
 5 files changed, 341 deletions(-)
 delete mode 100644 drivers/staging/vt6655/wctl.c
 delete mode 100644 drivers/staging/vt6655/wctl.h

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 5f3c019..115b951 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -7,7 +7,6 @@ vt6655_stage-y +=   device_main.o \
channel.o \
mac.o \
baseband.o \
-   wctl.o \
rxtx.o \
dpc.o \
power.o \
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 2c2f42f..d1e 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -60,7 +60,6 @@
 #include "mac.h"
 #include "tether.h"
 #include "wmgr.h"
-#include "wctl.h"
 #include "power.h"
 #include "wcmd.h"
 #include "iocmd.h"
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index b8ff8c6..00ae6de 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -55,7 +55,6 @@
 #include "bssdb.h"
 #include "mac.h"
 #include "baseband.h"
-#include "wctl.h"
 #include "rf.h"
 
 /*-  Static Definitions -*/
diff --git a/drivers/staging/vt6655/wctl.c b/drivers/staging/vt6655/wctl.c
deleted file mode 100644
index 5a54d98..000
--- a/drivers/staging/vt6655/wctl.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: wctl.c
- *
- * Purpose: handle WMAC duplicate filter & defragment
- *
- * Author: Jerry Chen
- *
- * Date: Jun. 27, 2002
- *
- * Functions:
- *  WCTLbIsDuplicate - Test if duplicate packet
- *  WCTLuSearchDFCB - Search DeFragment Control Database
- *  WCTLuInsertDFCB - Insert DeFragment Control Database
- *  WCTLbHandleFragment - Handle received fragment packet
- *
- * Revision History:
- *
- */
-
-#include "wctl.h"
-#include "device.h"
-#include "card.h"
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Variables  --*/
-
-/*-  Static Functions  --*/
-
-/*-  Export Variables  --*/
-
-/*
- * Description:
- *  Scan Rx cache.  Return true if packet is duplicate, else
- *  inserts in receive cache and returns false.
- *
- * Parameters:
- *  In:
- *  pCache  - Receive packets history
- *  pMACHeader  - 802.11 MAC Header of received packet
- *  Out:
- *  none
- *
- * Return Value: true if packet duplicate; otherwise false
- *
- */
-
-bool WCTLbIsDuplicate(PSCache pCache, PS802_11Header pMACHeader)
-{
-   unsigned int uIndex;
-   unsigned int ii;
-   PSCacheEntrypCacheEntry;
-
-   if (IS_FC_RETRY(pMACHeader)) {
-   uIndex = pCache->uInPtr;
-   for (ii = 0; ii < DUPLICATE_RX_CACHE_LENGTH; ii++) {
-   pCacheEntry = &(pCache->asCacheEntry[uIndex]);
-   if ((pCacheEntry->wFmSequence == pMACHeader->wSeqCtl) &&
-   ether_addr_equal(pCacheEntry->abyAddr2,
-pMACHeader->abyAddr2)) {
-   /* Duplicate match */
-   return true;
-   }
-   ADD_ONE_WITH_WRAP_AROUND(uIndex, 
DUPLICATE_RX_CACHE_LENGTH);
-   }
-   }
-   /* Not fount in cache - insert */
-   pCacheEntry = &pCache->asCacheEntry[pCache->uInPtr];
-   pCacheEntry->wFmSequence = pMACHeader->wSeqCtl;
-   memcpy(&(pCacheEntry->abyAddr2[0]), &(pMACHeader->abyAddr2[0]), 
ETH_ALEN);
-   ADD_ONE_WITH_WRAP_AROUND(pCache->uInPtr, DUPLICATE_RX_CACHE_LENGTH);
-   return false;
-}
-
-/*
- *

[PATCH v2 26/48] staging: vt6655: dead code remove tcrc.c/h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |   1 -
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/rxtx.c|   1 -
 drivers/staging/vt6655/tcrc.c| 191 ---
 drivers/staging/vt6655/tcrc.h|  50 -
 5 files changed, 244 deletions(-)
 delete mode 100644 drivers/staging/vt6655/tcrc.c
 delete mode 100644 drivers/staging/vt6655/tcrc.h

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 1a5876d..390c23e 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -14,7 +14,6 @@ vt6655_stage-y += device_main.o \
power.o \
srom.o \
mib.o \
-   tcrc.o \
key.o \
rf.o
 
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 18dad0c..2c2f42f 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -64,7 +64,6 @@
 #include "power.h"
 #include "wcmd.h"
 #include "iocmd.h"
-#include "tcrc.h"
 #include "rxtx.h"
 #include "bssdb.h"
 #include "dpc.h"
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 4770b9c..b8ff8c6 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -55,7 +55,6 @@
 #include "bssdb.h"
 #include "mac.h"
 #include "baseband.h"
-#include "tcrc.h"
 #include "wctl.h"
 #include "rf.h"
 
diff --git a/drivers/staging/vt6655/tcrc.c b/drivers/staging/vt6655/tcrc.c
deleted file mode 100644
index ddc5efd..000
--- a/drivers/staging/vt6655/tcrc.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 2003 VIA Networking, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: tcrc.c
- *
- * Purpose: Implement functions to calculate CRC
- *
- * Author: Tevin Chen
- *
- * Date: May 21, 1996
- *
- * Functions:
- *  CRCdwCrc32 -
- *  CRCdwGetCrc32 -
- *  CRCdwGetCrc32Ex -
- *
- * Revision History:
- *
- */
-
-#include "tcrc.h"
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Variables  --*/
-
-/* 32-bit CRC table */
-static const unsigned long s_adwCrc32Table[256] = {
-   0xL, 0x77073096L, 0xEE0E612CL, 0x990951BAL,
-   0x076DC419L, 0x706AF48FL, 0xE963A535L, 0x9E6495A3L,
-   0x0EDB8832L, 0x79DCB8A4L, 0xE0D5E91EL, 0x97D2D988L,
-   0x09B64C2BL, 0x7EB17CBDL, 0xE7B82D07L, 0x90BF1D91L,
-   0x1DB71064L, 0x6AB020F2L, 0xF3B97148L, 0x84BE41DEL,
-   0x1ADAD47DL, 0x6DDDE4EBL, 0xF4D4B551L, 0x83D385C7L,
-   0x136C9856L, 0x646BA8C0L, 0xFD62F97AL, 0x8A65C9ECL,
-   0x14015C4FL, 0x63066CD9L, 0xFA0F3D63L, 0x8D080DF5L,
-   0x3B6E20C8L, 0x4C69105EL, 0xD56041E4L, 0xA2677172L,
-   0x3C03E4D1L, 0x4B04D447L, 0xD20D85FDL, 0xA50AB56BL,
-   0x35B5A8FAL, 0x42B2986CL, 0xDBBBC9D6L, 0xACBCF940L,
-   0x32D86CE3L, 0x45DF5C75L, 0xDCD60DCFL, 0xABD13D59L,
-   0x26D930ACL, 0x51DE003AL, 0xC8D75180L, 0xBFD06116L,
-   0x21B4F4B5L, 0x56B3C423L, 0xCFBA9599L, 0xB8BDA50FL,
-   0x2802B89EL, 0x5F058808L, 0xC60CD9B2L, 0xB10BE924L,
-   0x2F6F7C87L, 0x58684C11L, 0xC1611DABL, 0xB6662D3DL,
-   0x76DC4190L, 0x01DB7106L, 0x98D220BCL, 0xEFD5102AL,
-   0x71B18589L, 0x06B6B51FL, 0x9FBFE4A5L, 0xE8B8D433L,
-   0x7807C9A2L, 0x0F00F934L, 0x9609A88EL, 0xE10E9818L,
-   0x7F6A0DBBL, 0x086D3D2DL, 0x91646C97L, 0xE6635C01L,
-   0x6B6B51F4L, 0x1C6C6162L, 0x856530D8L, 0xF262004EL,
-   0x6C0695EDL, 0x1B01A57BL, 0x8208F4C1L, 0xF50FC457L,
-   0x65B0D9C6L, 0x12B7E950L, 0x8BBEB8EAL, 0xFCB9887CL,
-   0x62DD1DDFL, 0x15DA2D49L, 0x8CD37CF3L, 0xFBD44C65L,
-   0x4DB26158L, 0x3AB551CEL, 0xA3BC0074L, 0xD4BB30E2L,
-   0x4ADFA541L, 0x3DD895D7L, 0xA4D1C46DL, 0xD3D6F4FBL,
-   0x4369E96AL, 0x346ED9FCL, 0xAD678846L, 0xDA60B8D0L,
-   0x44042D73L, 0x33031DE5L, 0xAA0A4C5FL, 0xDD0D7CC9L,
-   0x5005713CL, 0x270241AAL, 0xBE0B1010L, 0xC90C2086L,
-   0x5768B525L, 0x206F85B3L, 0xB966D409L, 0xCE61E49FL,
-   0x5EDEF90EL, 0x29D9C998L, 0xB0D09822L, 0xC7D7A8B4L,
-   0x59B33D17L, 0x2EB40D81L, 0xB7BD5C3BL, 0xC0BA6CADL,
-   0xEDB88320L, 0x9ABFB3B6L, 0x03B6E

[PATCH v2 17/48] staging: vt6655: card.c/h remove dead functions

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/card.c | 724 --
 drivers/staging/vt6655/card.h |  75 -
 2 files changed, 799 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 72896c1..bff77c8 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -34,8 +34,6 @@
  *  CARDvUpdateNextTBTT - Sync. NIC Beacon time
  *  CARDbRadioPowerOff - Turn Off NIC Radio Power
  *  CARDbRadioPowerOn - Turn On NIC Radio Power
- *  CARDbSetWEPMode - Set NIC Wep mode
- *  CARDbSetTxPower - Set NIC tx power
  *
  * Revision History:
  *  06-10-2003 Bryan YC Fan:  Re-write codes to support VT3253 spec.
@@ -50,12 +48,7 @@
 #include "mac.h"
 #include "desc.h"
 #include "rf.h"
-#include "vntwifi.h"
 #include "power.h"
-#include "key.h"
-#include "rc4.h"
-#include "country.h"
-#include "channel.h"
 
 /*-  Static Definitions -*/
 
@@ -201,43 +194,6 @@ s_vCalculateOFDMRParameter(
 /*-  Export Functions  --*/
 
 /*
- * Description: Get Card short preamble option value
- *
- * Parameters:
- *  In:
- *  pDevice - The adapter to be set
- *  Out:
- *  none
- *
- * Return Value: true if short preamble; otherwise false
- */
-bool CARDbIsShortPreamble(struct vnt_private *pDevice)
-{
-
-   if (pDevice->byPreambleType == 0)
-   return false;
-
-   return true;
-}
-
-/*
- * Description: Get Card short slot time option value
- *
- * Parameters:
- *  In:
- *  pDevice - The adapter to be set
- *  Out:
- *  none
- *
- * Return Value: true if short slot time; otherwise false
- */
-bool CARDbIsShorSlotTime(struct vnt_private *pDevice)
-{
-
-   return pDevice->bShortSlotTime;
-}
-
-/*
  * Description: Update IFS
  *
  * Parameters:
@@ -455,218 +411,6 @@ bool CARDbSetBeaconPeriod(struct vnt_private *pDevice,
 }
 
 /*
- * Description: Card Stop Hardware Tx
- *
- * Parameters:
- *  In:
- *  pDeviceHandler  - The adapter to be set
- *  ePktType- Packet type to stop
- *  Out:
- *  none
- *
- * Return Value: true if all data packet complete; otherwise false.
- */
-bool CARDbStopTxPacket(struct vnt_private *pDevice, CARD_PKT_TYPE ePktType)
-{
-
-   if (ePktType == PKT_TYPE_802_11_ALL) {
-   pDevice->bStopBeacon = true;
-   pDevice->bStopTx0Pkt = true;
-   pDevice->bStopDataPkt = true;
-   } else if (ePktType == PKT_TYPE_802_11_BCN) {
-   pDevice->bStopBeacon = true;
-   } else if (ePktType == PKT_TYPE_802_11_MNG) {
-   pDevice->bStopTx0Pkt = true;
-   } else if (ePktType == PKT_TYPE_802_11_DATA) {
-   pDevice->bStopDataPkt = true;
-   }
-
-   if (pDevice->bStopBeacon == true) {
-   if (pDevice->bIsBeaconBufReadySet == true) {
-   if (pDevice->cbBeaconBufReadySetCnt < 
WAIT_BEACON_TX_DOWN_TMO) {
-   pDevice->cbBeaconBufReadySetCnt++;
-   return false;
-   }
-   }
-   pDevice->bIsBeaconBufReadySet = false;
-   pDevice->cbBeaconBufReadySetCnt = 0;
-   MACvRegBitsOff(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX);
-   }
-   /* wait all TD0 complete */
-   if (pDevice->bStopTx0Pkt == true) {
-   if (pDevice->iTDUsed[TYPE_TXDMA0] != 0)
-   return false;
-   }
-   /* wait all Data TD complete */
-   if (pDevice->bStopDataPkt == true) {
-   if (pDevice->iTDUsed[TYPE_AC0DMA] != 0)
-   return false;
-   }
-
-   return true;
-}
-
-/*
- * Description: Card Start Hardware Tx
- *
- * Parameters:
- *  In:
- *  pDeviceHandler  - The adapter to be set
- *  ePktType- Packet type to start
- *  Out:
- *  none
- *
- * Return Value: true if success; false if failed.
- */
-bool CARDbStartTxPacket(struct vnt_private *pDevice, CARD_PKT_TYPE ePktType)
-{
-
-   if (ePktType == PKT_TYPE_802_11_ALL) {
-   pDevice->bStopBeacon = false;
-   pDevice->bStopTx0Pkt = false;
-   pDevice->bStopDataPkt = false;
-   } else if (ePktType == PKT_TYPE_802_11_BCN) {
-   pDevice->bStopBeacon = false;
-   } else if (ePktType == PKT_TYPE_802_11_MNG) {
-   pDevice->bStopTx0Pkt = false;
-   } else if (ePktType == PKT_TYPE_802_11_DATA) {
-   pDevice->bStopDataPkt = false;
-   }
-
-   if ((pDevice->bStopBeacon == false) &&
-   (pDevice->bBeaconBufReady == true) &&
-   (pDevice->op_mode == NL80211_IFTYPE_ADHOC)) {
-   MACvRegBitsOn(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX);
-   }
-
-   return true;
-}
-
-/*
- * Description: Card Set BSSID value
- *
- * Parameters:
- *  In:
- 

[PATCH v2 11/48] staging: vt6655: dead code remove wcmd.c

2014-10-29 Thread Malcolm Priestley
header will be removed later.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile |   1 -
 drivers/staging/vt6655/bssdb.c  |   7 -
 drivers/staging/vt6655/wcmd.c   | 958 
 drivers/staging/vt6655/wcmd.h   |  32 --
 4 files changed, 998 deletions(-)
 delete mode 100644 drivers/staging/vt6655/wcmd.c

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index fa154ef..271ca9d 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -9,7 +9,6 @@ vt6655_stage-y +=   device_main.o \
baseband.o \
wctl.o \
80211mgr.o \
-   wcmd.o \
bssdb.o \
rxtx.o \
dpc.o \
diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c
index 2b508ff..abe38e1 100644
--- a/drivers/staging/vt6655/bssdb.c
+++ b/drivers/staging/vt6655/bssdb.c
@@ -1092,7 +1092,6 @@ BSSvSecondCallBack(
if ((pMgmt->sNodeDBTable[0].uInActiveCount >= 
(LOST_BEACON_COUNT/2)) &&
(pDevice->byBBVGACurrent != pDevice->abyBBVGA[0])) {
pDevice->byBBVGANew = pDevice->abyBBVGA[0];
-   bScheduleCommand((void *)pDevice, 
WLAN_CMD_CHANGE_BBSENSITIVITY, NULL);
}
 
if (pMgmt->sNodeDBTable[0].uInActiveCount >= 
LOST_BEACON_COUNT) {
@@ -1151,8 +1150,6 @@ BSSvSecondCallBack(
pr_debug("Roaming ...\n");
BSSvClearBSSList((void *)pDevice, 
pDevice->bLinkPass);
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
-   bScheduleCommand((void *)pDevice, 
WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
-   bScheduleCommand((void *)pDevice, 
WLAN_CMD_SSID, pMgmt->abyDesireSSID);
pDevice->uAutoReConnectTime = 0;
}
}
@@ -1166,8 +1163,6 @@ BSSvSecondCallBack(
} else {
pr_info("Adhoc re-scanning ...\n");
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
-   bScheduleCommand((void *)pDevice, 
WLAN_CMD_BSSID_SCAN, NULL);
-   bScheduleCommand((void *)pDevice, 
WLAN_CMD_SSID, NULL);
pDevice->uAutoReConnectTime = 0;
}
}
@@ -1430,8 +1425,6 @@ void s_vCheckSensitivity(
}
if (pDevice->byBBVGANew != 
pDevice->byBBVGACurrent) {
pDevice->uBBVGADiffCount++;
-   if (pDevice->uBBVGADiffCount >= 
BB_VGA_CHANGE_THRESHOLD)
-   bScheduleCommand((void 
*)pDevice, WLAN_CMD_CHANGE_BBSENSITIVITY, NULL);
} else {
pDevice->uBBVGADiffCount = 0;
}
diff --git a/drivers/staging/vt6655/wcmd.c b/drivers/staging/vt6655/wcmd.c
deleted file mode 100644
index 3c98080..000
--- a/drivers/staging/vt6655/wcmd.c
+++ /dev/null
@@ -1,958 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: wcmd.c
- *
- * Purpose: Handles the management command interface functions
- *
- * Author: Lyndon Chen
- *
- * Date: May 8, 2003
- *
- * Functions:
- *  s_vProbeChannel - Active scan channel
- *  s_MgrMakeProbeRequest - Make ProbeRequest packet
- *  CommandTimer - Timer function to handle command
- *  s_bCommandComplete - Command Complete function
- *  bScheduleCommand - Push Command and wait Command Scheduler to do
- *  vCommandTimer- Command call back functions
- *  vCommandTimerWait- Call back timer
- *  bClearBSSID_SCAN- Clear BSSID_SCAN cmd in CMD Queue
- *
- * Revision History:
- *
- */
-
-#include "ttype.h"
-#include "tmacro.h"
-#include "device.h"
-#include "mac.h"
-#include "card.h"
-#include "80211hdr.h"
-#include "wcmd.h"
-#include "wmgr.h"
-#include "power.h"
-#include "wctl.h"
-#include "baseban

[PATCH v2 16/48] staging: vt6655: dead code remove IEEE11.h.c/h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/IEEE11h.c | 139 ---
 drivers/staging/vt6655/IEEE11h.h |  42 
 drivers/staging/vt6655/Makefile  |   3 +-
 drivers/staging/vt6655/vntwifi.c |   3 -
 4 files changed, 1 insertion(+), 186 deletions(-)
 delete mode 100644 drivers/staging/vt6655/IEEE11h.c
 delete mode 100644 drivers/staging/vt6655/IEEE11h.h

diff --git a/drivers/staging/vt6655/IEEE11h.c b/drivers/staging/vt6655/IEEE11h.c
deleted file mode 100644
index 65eb482..000
--- a/drivers/staging/vt6655/IEEE11h.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 1996, 2005 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: IEEE11h.c
- *
- * Purpose:
- *
- * Functions:
- *
- * Revision History:
- *
- * Author: Yiching Chen
- *
- * Date: Mar. 31, 2005
- *
- */
-
-#include "ttype.h"
-#include "tmacro.h"
-#include "tether.h"
-#include "IEEE11h.h"
-#include "device.h"
-#include "wmgr.h"
-#include "rxtx.h"
-#include "channel.h"
-
-/*-  Static Definitions -*/
-
-#pragma pack(1)
-
-typedef struct _WLAN_FRAME_ACTION {
-   WLAN_80211HDR_A3Header;
-   unsigned char byCategory;
-   unsigned char byAction;
-   unsigned char abyVars[1];
-} WLAN_FRAME_ACTION, *PWLAN_FRAME_ACTION;
-
-typedef struct _WLAN_FRAME_MSRREQ {
-   WLAN_80211HDR_A3Header;
-   unsigned char byCategory;
-   unsigned char byAction;
-   unsigned char byDialogToken;
-   WLAN_IE_MEASURE_REQ sMSRReqEIDs[1];
-} WLAN_FRAME_MSRREQ, *PWLAN_FRAME_MSRREQ;
-
-typedef struct _WLAN_FRAME_MSRREP {
-   WLAN_80211HDR_A3Header;
-   unsigned char byCategory;
-   unsigned char byAction;
-   unsigned char byDialogToken;
-   WLAN_IE_MEASURE_REP sMSRRepEIDs[1];
-} WLAN_FRAME_MSRREP, *PWLAN_FRAME_MSRREP;
-
-typedef struct _WLAN_FRAME_TPCREQ {
-   WLAN_80211HDR_A3Header;
-   unsigned char byCategory;
-   unsigned char byAction;
-   unsigned char byDialogToken;
-   WLAN_IE_TPC_REQ sTPCReqEIDs;
-} WLAN_FRAME_TPCREQ, *PWLAN_FRAME_TPCREQ;
-
-typedef struct _WLAN_FRAME_TPCREP {
-   WLAN_80211HDR_A3Header;
-   unsigned char byCategory;
-   unsigned char byAction;
-   unsigned char byDialogToken;
-   WLAN_IE_TPC_REP sTPCRepEIDs;
-} WLAN_FRAME_TPCREP, *PWLAN_FRAME_TPCREP;
-
-#pragma pack()
-
-/* action field reference ieee 802.11h Table 20e */
-#define ACTION_MSRREQ   0
-#define ACTION_MSRREP   1
-#define ACTION_TPCREQ   2
-#define ACTION_TPCREP   3
-#define ACTION_CHSW 4
-
-/*-  Static Classes  */
-
-/*-  Static Variables  --*/
-
-/*-  Static Functions  --*/
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
-bool IEEE11hbMSRRepTx(void *pMgmtHandle)
-{
-   PSMgmtObjectpMgmt = (PSMgmtObject) pMgmtHandle;
-   PWLAN_FRAME_MSRREP  pMSRRep = (PWLAN_FRAME_MSRREP)
-   (pMgmt->abyCurrentMSRRep + sizeof(STxMgmtPacket));
-   size_tuLength = 0;
-   PSTxMgmtPacket  pTxPacket = NULL;
-
-   pTxPacket = (PSTxMgmtPacket)pMgmt->abyCurrentMSRRep;
-   memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN);
-   pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket +
-   sizeof(STxMgmtPacket));
-
-   pMSRRep->Header.wFrameCtl = (WLAN_SET_FC_FTYPE(WLAN_FTYPE_MGMT) |
-WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_ACTION)
-);
-
-   memcpy(pMSRRep->Header.abyAddr1, ((PWLAN_FRAME_MSRREQ)
- 
(pMgmt->abyCurrentMSRReq))->Header.abyAddr2, WLAN_ADDR_LEN);
-   memcpy(pMSRRep->Header.abyAddr2,
-  CARDpGetCurrentAddress(pMgmt->pAdapter), WLAN_ADDR_LEN);
-   memcpy(pMSRRep->Header.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN);
-
-   pMSRRep->byCategory = 0;
-   pMSRRep->byAction = 1;
-   pMSRRep->byDialogToken = ((PWLAN_FRAME_MSR

[PATCH v2 21/48] staging: vt6655: dead code remove michael.c/h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |   1 -
 drivers/staging/vt6655/michael.c | 148 ---
 drivers/staging/vt6655/michael.h |  52 --
 drivers/staging/vt6655/rxtx.c|   1 -
 4 files changed, 202 deletions(-)
 delete mode 100644 drivers/staging/vt6655/michael.c
 delete mode 100644 drivers/staging/vt6655/michael.h

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index f49f12b..5449ced 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -17,7 +17,6 @@ vt6655_stage-y += device_main.o \
tether.o \
tcrc.o \
key.o \
-   michael.o \
rf.o \
vntwifi.o
 
diff --git a/drivers/staging/vt6655/michael.c b/drivers/staging/vt6655/michael.c
deleted file mode 100644
index edee487..000
--- a/drivers/staging/vt6655/michael.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: michael.cpp
- *
- * Purpose: The implementation of LIST data structure.
- *
- * Author: Kyle Hsu
- *
- * Date: Sep 4, 2002
- *
- * Functions:
- *  s_dwGetUINT32 - Convert from unsigned char [] to unsigned long in a 
portable way
- *  s_vPutUINT32 - Convert from unsigned long to unsigned char [] in a 
portable way
- *  s_vClear - Reset the state to the empty message.
- *  s_vSetKey - Set the key.
- *  MIC_vInit - Set the key.
- *  s_vAppendByte - Append the byte to our word-sized buffer.
- *  MIC_vAppend - call s_vAppendByte.
- *  MIC_vGetMIC - Append the minimum padding and call s_vAppendByte.
- *
- * Revision History:
- *
- */
-
-#include "tmacro.h"
-#include "michael.h"
-
-/*-  Static Definitions -*/
-
-/*-  Static Variables  --*/
-
-/*-  Static Functions  --*/
-
-static void s_vClear(void);   // Clear the internal 
message,
-// resets the object to the state just after construction.
-static void s_vSetKey(u32  dwK0, u32  dwK1);
-static void s_vAppendByte(unsigned char b);// Add a single byte to 
the internal message
-
-/*-  Export Variables  --*/
-static u32 L, R;   /* Current state */
-
-static u32 K0, K1; /* Key */
-static u32 M;  /* Message accumulator (single word) */
-static unsigned int nBytesInM;  // # bytes in M
-
-/*-  Export Functions  --*/
-
-static void s_vClear(void)
-{
-   // Reset the state to the empty message.
-   L = K0;
-   R = K1;
-   nBytesInM = 0;
-   M = 0;
-}
-
-static void s_vSetKey(u32 dwK0, u32 dwK1)
-{
-   // Set the key
-   K0 = dwK0;
-   K1 = dwK1;
-   // and reset the message
-   s_vClear();
-}
-
-static void s_vAppendByte(unsigned char b)
-{
-   // Append the byte to our word-sized buffer
-   M |= b << (8*nBytesInM);
-   nBytesInM++;
-   // Process the word if it is full.
-   if (nBytesInM >= 4) {
-   L ^= M;
-   R ^= ROL32(L, 17);
-   L += R;
-   R ^= ((L & 0xff00ff00) >> 8) | ((L & 0x00ff00ff) << 8);
-   L += R;
-   R ^= ROL32(L, 3);
-   L += R;
-   R ^= ROR32(L, 2);
-   L += R;
-   // Clear the buffer
-   M = 0;
-   nBytesInM = 0;
-   }
-}
-
-void MIC_vInit(u32 dwK0, u32 dwK1)
-{
-   // Set the key
-   s_vSetKey(dwK0, dwK1);
-}
-
-void MIC_vUnInit(void)
-{
-   // Wipe the key material
-   K0 = 0;
-   K1 = 0;
-
-   // And the other fields as well.
-   //Note that this sets (L,R) to (K0,K1) which is just fine.
-   s_vClear();
-}
-
-void MIC_vAppend(unsigned char *src, unsigned int nBytes)
-{
-   // This is simple
-   while (nBytes > 0) {
-   s_vAppendByte(*src++);
-   nBytes--;
-   }
-}
-
-void MIC_vGetMIC(u32 *pdwL, u32 *pdwR)
-{
-   // Append the minimum padding
-   s_vAppendByte(0x5a);
-   s_vAppendByte(0);
-   s_vAppendByte(0)

[PATCH v2 13/48] staging: vt6655: s_cbFillTxBufHead remove unused parameters

2014-10-29 Thread Malcolm Priestley
Remove the following parameters
PSEthernetHeader psEthHeader
PSKeyItem pTransmitKey
bool bNeedEncrypt

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/rxtx.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 5c460ad..c47042c 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -138,9 +138,8 @@ static unsigned int
 s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
  unsigned char *pbyTxBufferAddr, unsigned int cbFrameBodySize,
  unsigned int uDMAIdx, PSTxDesc pHeadTD,
- PSEthernetHeader psEthHeader, unsigned char *pPacket,
- bool bNeedEncrypt, PSKeyItem pTransmitKey,
- unsigned int uNodeIndex, unsigned int *puMACfragNum);
+ unsigned char *pPacket, unsigned int uNodeIndex,
+ unsigned int *puMACfragNum);
 
 static
 __le16
@@ -1041,9 +1040,8 @@ static unsigned int
 s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
  unsigned char *pbyTxBufferAddr, unsigned int cbFrameBodySize,
  unsigned int uDMAIdx, PSTxDesc pHeadTD,
- PSEthernetHeader psEthHeader, unsigned char *pPacket,
- bool bNeedEncrypt, PSKeyItem pTransmitKey,
- unsigned int is_pspoll, unsigned int *puMACfragNum)
+ unsigned char *pPacket, unsigned int is_pspoll,
+ unsigned int *puMACfragNum)
 {
PDEVICE_TD_INFO td_info = pHeadTD->pTDInfo;
struct sk_buff *skb = td_info->skb;
@@ -1413,8 +1411,8 @@ int vnt_generate_fifo_header(struct vnt_private *priv, 
u32 dma_idx,
tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_NONFRAG);
 
s_cbFillTxBufHead(priv, pkt_type, (u8 *)tx_buffer_head, skb->len,
- dma_idx, head_td, NULL, (u8 *)skb->data,
- false, NULL, is_pspoll, &frag);
+ dma_idx, head_td, (u8 *)skb->data,
+ is_pspoll, &frag);
 
if (info->control.hw_key) {
tx_key = info->control.hw_key;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 03/48] staging: vt6655: dead code remove net device code

2014-10-29 Thread Malcolm Priestley
All functions are dead and nolonger of use.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h  |2 -
 drivers/staging/vt6655/device_main.c | 1176 --
 drivers/staging/vt6655/wcmd.c|4 -
 3 files changed, 1182 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 214f73f..6729d23 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -746,8 +746,6 @@ static inline PDEVICE_TD_INFO alloc_td_info(void)
 
 /*-  Export Functions  --*/
 
-bool device_dma0_xmit(struct vnt_private *pDevice,
- struct sk_buff *skb, unsigned int uNodeIndex);
 bool device_alloc_frag_buf(struct vnt_private *pDevice,
   PSDeFragControlBlock pDeF);
 #endif
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 12fa63c..870016a 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -32,20 +32,12 @@
  *   device_free_info - device structure resource free function
  *   device_get_pci_info - get allocated pci io/mem resource
  *   device_print_info - print out resource
- *   device_open - allocate dma/descripter resource & initial mac/bbp function
- *   device_xmit - asynchrous data tx function
  *   device_intr - interrupt handle function
- *   device_set_multi - set mac filter
- *   device_ioctl - ioctl entry
- *   device_close - shutdown mac/bbp & free dma/descripter resource
  *   device_rx_srv - rx service function
- *   device_receive_frame - rx data function
  *   device_alloc_rx_buf - rx buffer pre-allocated function
  *   device_alloc_frag_buf - rx fragement pre-allocated function
  *   device_free_tx_buf - free tx buffer function
  *   device_free_frag_buf- free de-fragement buffer
- *   device_dma0_tx_80211- tx 802.11 frame via dma0
- *   device_dma0_xmit- tx PS bufferred frame via dma0
  *   device_init_rd0_ring- initial rd dma0 ring
  *   device_init_rd1_ring- initial rd dma1 ring
  *   device_init_td0_ring- initial tx dma0 ring buffer
@@ -265,12 +257,7 @@ static void device_free_info(struct vnt_private *pDevice);
 static bool device_get_pci_info(struct vnt_private *, struct pci_dev *pcid);
 static void device_print_info(struct vnt_private *pDevice);
 static void device_init_diversity_timer(struct vnt_private *pDevice);
-static int  device_open(struct net_device *dev);
-static int  device_xmit(struct sk_buff *skb, struct net_device *dev);
 static  irqreturn_t  device_intr(int irq,  void *dev_instance);
-static void device_set_multi(struct net_device *dev);
-static int  device_close(struct net_device *dev);
-static int  device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 
 #ifdef CONFIG_PM
 static int device_notify_reboot(struct notifier_block *, unsigned long event, 
void *ptr);
@@ -287,11 +274,6 @@ static void device_init_defrag_cb(struct vnt_private 
*pDevice);
 static void device_init_td0_ring(struct vnt_private *pDevice);
 static void device_init_td1_ring(struct vnt_private *pDevice);
 
-static int  device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev);
-//2008-0714by Mike Liu
-static bool device_release_WPADEV(struct vnt_private *pDevice);
-
-static int  ethtool_ioctl(struct net_device *dev, void __user *useraddr);
 static int  device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx);
 static int  device_tx_srv(struct vnt_private *pDevice, unsigned int uIdx);
 static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pDesc);
@@ -672,45 +654,6 @@ static void device_init_diversity_timer(struct vnt_private 
*pDevice)
pDevice->TimerSQ3Tmax3.expires = RUN_AT(HZ);
 }
 
-static bool device_release_WPADEV(struct vnt_private *pDevice)
-{
-   viawget_wpa_header *wpahdr;
-   int ii = 0;
-
-   //send device close to wpa_supplicnat layer
-   if (pDevice->bWPADEVUp) {
-   wpahdr = (viawget_wpa_header *)pDevice->skb->data;
-   wpahdr->type = VIAWGET_DEVICECLOSE_MSG;
-   wpahdr->resp_ie_len = 0;
-   wpahdr->req_ie_len = 0;
-   skb_put(pDevice->skb, sizeof(viawget_wpa_header));
-   pDevice->skb->dev = pDevice->wpadev;
-   skb_reset_mac_header(pDevice->skb);
-   pDevice->skb->pkt_type = PACKET_HOST;
-   pDevice->skb->protocol = htons(ETH_P_802_2);
-   memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
-   netif_rx(pDevice->skb);
-   pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
-
-   while (pDevice->bWPADEVUp) {
-   set_current_state(TASK_UNINTERRUPTIBLE);
-   schedule_timeout(HZ / 20);  //wait 50ms
-   ii++;
-   if (ii > 20)
-   break;
-   }
-   }
-   return true;

[PATCH v2 22/48] staging: vt6655: dead code remove vntwifi.c functions

2014-10-29 Thread Malcolm Priestley
Header will be removed later

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |   3 +-
 drivers/staging/vt6655/vntwifi.c | 658 ---
 drivers/staging/vt6655/vntwifi.h | 168 --
 3 files changed, 1 insertion(+), 828 deletions(-)
 delete mode 100644 drivers/staging/vt6655/vntwifi.c

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 5449ced..d571e6f 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -17,7 +17,6 @@ vt6655_stage-y += device_main.o \
tether.o \
tcrc.o \
key.o \
-   rf.o \
-   vntwifi.o
+   rf.o
 
 obj-$(CONFIG_VT6655) +=vt6655_stage.o
diff --git a/drivers/staging/vt6655/vntwifi.c b/drivers/staging/vt6655/vntwifi.c
deleted file mode 100644
index 54c65fc..000
--- a/drivers/staging/vt6655/vntwifi.c
+++ /dev/null
@@ -1,658 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: vntwifi.c
- *
- * Purpose: export functions for vntwifi lib
- *
- * Functions:
- *
- * Revision History:
- *
- * Author: Yiching Chen
- *
- * Date: feb. 2, 2005
- *
- */
-
-#include "vntwifi.h"
-#include "country.h"
-#include "device.h"
-#include "wmgr.h"
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Variables  --*/
-
-/*-  Static Functions  --*/
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
-/*+
- *
- * Description:
- *Set Operation Mode
- *
- * Parameters:
- *  In:
- *  pMgmtHandle - pointer to management object
- *  eOPMode - Operation Mode
- *  Out:
- *  none
- *
- * Return Value: none
- *
- -*/
-void
-VNTWIFIvSetOPMode(
-   void *pMgmtHandle,
-   WMAC_CONFIG_MODE eOPMode
-)
-{
-   PSMgmtObjectpMgmt = (PSMgmtObject)pMgmtHandle;
-
-   pMgmt->eConfigMode = eOPMode;
-}
-
-/*+
- *
- * Description:
- *Set Operation Mode
- *
- * Parameters:
- *  In:
- *  pMgmtHandle - pointer to management object
- *  wBeaconPeriod - Beacon Period
- *  wATIMWindow - ATIM window
- *  uChannel - channel number
- *  Out:
- *  none
- *
- * Return Value: none
- *
- -*/
-void
-VNTWIFIvSetIBSSParameter(
-   void *pMgmtHandle,
-   unsigned short wBeaconPeriod,
-   unsigned short wATIMWindow,
-   unsigned int uChannel
-)
-{
-   PSMgmtObjectpMgmt = (PSMgmtObject)pMgmtHandle;
-
-   pMgmt->wIBSSBeaconPeriod = wBeaconPeriod;
-   pMgmt->wIBSSATIMWindow = wATIMWindow;
-   pMgmt->uIBSSChannel = uChannel;
-}
-
-/*+
- *
- * Description:
- *Get current SSID
- *
- * Parameters:
- *  In:
- *  pMgmtHandle - pointer to management object
- *  Out:
- *  none
- *
- * Return Value: current SSID pointer.
- *
- -*/
-PWLAN_IE_SSID
-VNTWIFIpGetCurrentSSID(
-   void *pMgmtHandle
-)
-{
-   PSMgmtObjectpMgmt = (PSMgmtObject)pMgmtHandle;
-
-   return (PWLAN_IE_SSID) pMgmt->abyCurrSSID;
-}
-
-/*+
- *
- * Description:
- *Get current link channel
- *
- * Parameters:
- *  In:
- *  pMgmtHandle - pointer to management object
- *  Out:
- *  none
- *
- * Return Value: current Channel.
- *
- -*/
-unsigned int
-VNTWIFIpGetCurrentChannel(
-   void *pMgmtHandle
-)
-{
-   PSMgmtObjectpMgmt = (PSMgmtObject)pMgmtHandle;
-
-   if (pMgmtHandle != NULL)
-   return pMgmt->uCurrChannel;
-
-   return 0;
-}
-
-/*+
- *
- * Description:
- *Get current Assoc ID
- *
- * Parameters:
- *  In:
- *  pMgmtHandle - pointer to management object
- *  Out:
- *  none
- *
- * Return Value: current Assoc ID
- *
- -*/
-unsigned short
-VNTWIFIwGetAssocID(
-   void *pMgmtHandle
-)
-{
-   PSMgmtObjectpMgmt = (PSMgmtObject)pMgmtHandle;
-
-   return pMgmt->wCurrAID;
-}
-
-/*+
- *
- * Description:
- *This routine return max support rate of IES
- *
- * Parameters:
- *  In:
- *  pSupportRateIEs
- *  pExtSupportRateIEs
- *
- * 

[PATCH v2 04/48] staging: vt6655: dead code remove iwctl.c/h

2014-10-29 Thread Malcolm Priestley
The iw handler and functions are nolonger required.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |1 -
 drivers/staging/vt6655/device_main.c |1 -
 drivers/staging/vt6655/iwctl.c   | 1858 --
 drivers/staging/vt6655/iwctl.h   |  206 
 4 files changed, 2066 deletions(-)
 delete mode 100644 drivers/staging/vt6655/iwctl.c
 delete mode 100644 drivers/staging/vt6655/iwctl.h

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index f7544a6..455f088 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -29,7 +29,6 @@ vt6655_stage-y += device_main.o \
michael.o \
wroute.o \
rf.o \
-   iwctl.o \
wpactl.o \
wpa2.o \
aes_ccmp.o \
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 870016a..51b20f3 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -71,7 +71,6 @@
 #include "hostap.h"
 #include "wpactl.h"
 #include "ioctl.h"
-#include "iwctl.h"
 #include "dpc.h"
 #include "datarate.h"
 #include "rf.h"
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
deleted file mode 100644
index cbcb152a..000
--- a/drivers/staging/vt6655/iwctl.c
+++ /dev/null
@@ -1,1858 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: iwctl.c
- *
- * Purpose:  wireless ext & ioctl functions
- *
- * Author: Lyndon Chen
- *
- * Date: July 5, 2006
- *
- * Functions:
- *
- * Revision History:
- *
- */
-
-#include "device.h"
-#include "ioctl.h"
-#include "iocmd.h"
-#include "iwctl.h"
-#include "mac.h"
-#include "card.h"
-#include "hostap.h"
-#include "power.h"
-#include "rf.h"
-
-#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
-#include "iowpa.h"
-#include "wpactl.h"
-#endif
-
-#include 
-extern unsigned short TxRate_iwconfig;
-
-/*-  Static Definitions -*/
-
-#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
-#define SUPPORTED_WIRELESS_EXT  18
-#else
-#define SUPPORTED_WIRELESS_EXT  17
-#endif
-
-static const long frequency_list[] = {
-   2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447, 2452, 2457, 2462, 2467, 
2472, 2484,
-   4915, 4920, 4925, 4935, 4940, 4945, 4960, 4980,
-   5035, 5040, 5045, 5055, 5060, 5080, 5170, 5180, 5190, 5200, 5210, 5220, 
5230, 5240,
-   5260, 5280, 5300, 5320, 5500, 5520, 5540, 5560, 5580, 5600, 5620, 5640, 
5660, 5680,
-   5700, 5745, 5765, 5785, 5805, 5825
-};
-
-/*-  Static Classes  */
-/*-  Static Variables  --*/
-/*-  Static Functions  --*/
-
-/*-  Export Variables  --*/
-
-struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev)
-{
-   struct vnt_private *pDevice = netdev_priv(dev);
-   long ldBm;
-
-   pDevice->wstats.status = pDevice->op_mode;
-#ifdef Calcu_LinkQual
-   if (pDevice->scStatistic.LinkQuality > 100)
-   pDevice->scStatistic.LinkQuality = 100;
-   pDevice->wstats.qual.qual = (unsigned 
char)pDevice->scStatistic.LinkQuality;
-#else
-   pDevice->wstats.qual.qual = pDevice->byCurrSQ;
-#endif
-   RFvRSSITodBm(pDevice, (unsigned char)(pDevice->uCurrRSSI), &ldBm);
-   pDevice->wstats.qual.level = ldBm;
-   pDevice->wstats.qual.noise = 0;
-   pDevice->wstats.qual.updated = 1;
-   pDevice->wstats.discard.nwid = 0;
-   pDevice->wstats.discard.code = 0;
-   pDevice->wstats.discard.fragment = 0;
-   pDevice->wstats.discard.retries = (unsigned 
long)pDevice->scStatistic.dwTsrErr;
-   pDevice->wstats.discard.misc = 0;
-   pDevice->wstats.miss.beacon = 0;
-
-   return &pDevice->wstats;
-}
-
-/*--*/
-
-static int iwctl_commit(struct net_device *dev,
-   struct iw_request_info *info,
-   void *wrq,
-   char *extra)
-{
-   pr_debug(" SIOCSIWCOMMIT\n");
-

[PATCH v2 08/48] staging: vt6655: dpc.c/h remove dead functions

2014-10-29 Thread Malcolm Priestley
s_byGetRateIdx
s_vGetDASA
s_vProcessRxMACHeader
s_bAPModeRxCtl
s_bAPModeRxData
s_bHandleRxEncryption
s_bHostWepRxEncryption
s_vProcessRxMACHeader
s_byGetRateIdx
s_vGetDASA
device_receive_frame
s_bAPModeRxCtl

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/dpc.c | 1286 --
 drivers/staging/vt6655/dpc.h |8 -
 2 files changed, 1294 deletions(-)

diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index 6842baf..977683c 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -25,1302 +25,16 @@
  * Date: May 20, 2003
  *
  * Functions:
- *  device_receive_frame - Rcv 802.11 frame function
- *  s_bAPModeRxCtl- AP Rcv frame filer Ctl.
- *  s_bAPModeRxData- AP Rcv data frame handle
- *  s_bHandleRxEncryption- Rcv decrypted data via on-fly
- *  s_bHostWepRxEncryption- Rcv encrypted data via host
- *  s_byGetRateIdx- get rate index
- *  s_vGetDASA- get data offset
- *  s_vProcessRxMACHeader- Rcv 802.11 and translate to 802.3
  *
  * Revision History:
  *
  */
 
 #include "device.h"
-#include "rxtx.h"
-#include "tether.h"
-#include "card.h"
-#include "bssdb.h"
-#include "mac.h"
 #include "baseband.h"
-#include "michael.h"
-#include "tkip.h"
-#include "tcrc.h"
-#include "wctl.h"
-#include "wroute.h"
 #include "rf.h"
-#include "iowpa.h"
-#include "aes_ccmp.h"
 #include "dpc.h"
 
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Variables  --*/
-static const unsigned char acbyRxRate[MAX_RATE] =
-{2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108};
-
-/*-  Static Functions  --*/
-
-/*-  Static Definitions -*/
-
-/*-  Static Functions  --*/
-
-static unsigned char s_byGetRateIdx(unsigned char byRate);
-
-static void
-s_vGetDASA(unsigned char *pbyRxBufferAddr, unsigned int *pcbHeaderSize,
-  PSEthernetHeader psEthHeader);
-
-static void
-s_vProcessRxMACHeader(struct vnt_private *pDevice, unsigned char 
*pbyRxBufferAddr,
- unsigned int cbPacketSize, bool bIsWEP, bool bExtIV,
- unsigned int *pcbHeadSize);
-
-static bool s_bAPModeRxCtl(
-   struct vnt_private *pDevice,
-   unsigned char *pbyFrame,
-   int  iSANodeIndex
-);
-
-static bool s_bAPModeRxData(
-   struct vnt_private *pDevice,
-   struct sk_buff *skb,
-   unsigned int FrameSize,
-   unsigned int cbHeaderOffset,
-   int  iSANodeIndex,
-   int  iDANodeIndex
-);
-
-static bool s_bHandleRxEncryption(
-   struct vnt_private *pDevice,
-   unsigned char *pbyFrame,
-   unsigned int FrameSize,
-   unsigned char *pbyRsr,
-   unsigned char *pbyNewRsr,
-   PSKeyItem   *pKeyOut,
-   bool *pbExtIV,
-   unsigned short *pwRxTSC15_0,
-   unsigned long *pdwRxTSC47_16
-);
-
-static bool s_bHostWepRxEncryption(
-
-   struct vnt_private *pDevice,
-   unsigned char *pbyFrame,
-   unsigned int FrameSize,
-   unsigned char *pbyRsr,
-   bool bOnFly,
-   PSKeyItempKey,
-   unsigned char *pbyNewRsr,
-   bool *pbExtIV,
-   unsigned short *pwRxTSC15_0,
-   unsigned long *pdwRxTSC47_16
-
-);
-
-/*-  Export Variables  --*/
-
-/*+
- *
- * Description:
- *Translate Rcv 802.11 header to 802.3 header with Rx buffer
- *
- * Parameters:
- *  In:
- *  pDevice
- *  dwRxBufferAddr  - Address of Rcv Buffer
- *  cbPacketSize- Rcv Packet size
- *  bIsWEP  - If Rcv with WEP
- *  Out:
- *  pcbHeaderSize   - 802.11 header size
- *
- * Return Value: None
- *
- -*/
-static void
-s_vProcessRxMACHeader(struct vnt_private *pDevice,
- unsigned char *pbyRxBufferAddr,
- unsigned int cbPacketSize, bool bIsWEP, bool bExtIV,
- unsigned int *pcbHeadSize)
-{
-   unsigned char *pbyRxBuffer;
-   unsigned int cbHeaderSize = 0;
-   unsigned short *pwType;
-   PS802_11Header  pMACHeader;
-   int ii;
-
-   pMACHeader = (PS802_11Header) (pbyRxBufferAddr + cbHeaderSize);
-
-   s_vGetDASA((unsigned char *)pMACHeader, &cbHeaderSize, 
&pDevice->sRxEthHeader);
-
-   if (bIsWEP) {
-   if (bExtIV) {
-   /* strip IV&ExtIV, add 8 byte */
-   cbHeaderSize += (WLAN_HDR_ADDR3_LEN + 8);
-   } else {
-   /* strip IV, add 4 byte */
-   cbHeaderSize += (WLAN_HDR_ADDR3_LEN + 4);
-   }
-   } else {
-   cbHeaderSize += WLAN_HDR_ADDR3_LEN;
-   }
-
-   pbyRxBuffer = (unsigned char *)(pbyRxBufferAddr + cbHeaderSize);
-   if (ether_addr_equal(pbyR

[PATCH v2 15/48] staging: vt6655: dead code datarate.c/h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |   1 -
 drivers/staging/vt6655/datarate.c| 410 ---
 drivers/staging/vt6655/datarate.h|  78 ---
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/vntwifi.c |  14 --
 5 files changed, 504 deletions(-)
 delete mode 100644 drivers/staging/vt6655/datarate.c
 delete mode 100644 drivers/staging/vt6655/datarate.h

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 2c0b7932..3c993a8 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -12,7 +12,6 @@ vt6655_stage-y += device_main.o \
rxtx.o \
dpc.o \
power.o \
-   datarate.o \
srom.o \
mib.o \
rc4.o \
diff --git a/drivers/staging/vt6655/datarate.c 
b/drivers/staging/vt6655/datarate.c
deleted file mode 100644
index 52907a4..000
--- a/drivers/staging/vt6655/datarate.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: datarate.c
- *
- * Purpose: Handles the auto fallback & data rates functions
- *
- * Author: Lyndon Chen
- *
- * Date: July 17, 2002
- *
- * Functions:
- *  RATEvParseMaxRate - Parsing the highest basic & support rate in rate 
field of frame
- *  RATEvTxRateFallBack - Rate fallback Algorithm Implementaion
- *  RATEuSetIE- Set rate IE field.
- *
- * Revision History:
- *
- */
-
-#include "ttype.h"
-#include "tmacro.h"
-#include "mac.h"
-#include "80211mgr.h"
-#include "bssdb.h"
-#include "datarate.h"
-#include "card.h"
-#include "baseband.h"
-#include "srom.h"
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-extern unsigned short TxRate_iwconfig; /* 2008-5-8  by chester */
-/*-  Static Variables  --*/
-static const unsigned char acbyIERate[MAX_RATE] = {
-0x02, 0x04, 0x0B, 0x16, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C
-};
-
-#define AUTORATE_TXOK_CNT   0x0400
-#define AUTORATE_TXFAIL_CNT 0x0064
-#define AUTORATE_TIMEOUT10
-
-/*-  Static Functions  --*/
-
-void s_vResetCounter(
-   PKnownNodeDB psNodeDBTable
-);
-
-void
-s_vResetCounter(
-   PKnownNodeDB psNodeDBTable
-)
-{
-   unsigned char ii;
-
-   /* clear statistic counter for auto_rate */
-   for (ii = 0; ii <= MAX_RATE; ii++) {
-   psNodeDBTable->uTxOk[ii] = 0;
-   psNodeDBTable->uTxFail[ii] = 0;
-   }
-}
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
-/*+
- *
- * Description:
- *  Get RateIdx from the value in SuppRates IE or ExtSuppRates IE
- *
- * Parameters:
- *  In:
- *  unsigned char - Rate value in SuppRates IE or ExtSuppRates IE
- *  Out:
- *  none
- *
- * Return Value: RateIdx
- *
- -*/
-unsigned char
-DATARATEbyGetRateIdx(
-   unsigned char byRate
-)
-{
-   unsigned char ii;
-
-   /* Erase basicRate flag. */
-   byRate = byRate & 0x7F;/* 0111  */
-
-   for (ii = 0; ii < MAX_RATE; ii++) {
-   if (acbyIERate[ii] == byRate)
-   return ii;
-   }
-   return 0;
-}
-
-/*+
- *
- * Routine Description:
- *  Rate fallback Algorithm Implementation
- *
- * Parameters:
- *  In:
- *  pDevice - Pointer to the adapter
- *  psNodeDBTable   - Pointer to Node Data Base
- *  Out:
- *  none
- *
- * Return Value: none
- *
- -*/
-#define AUTORATE_TXCNT_THRESHOLD20
-#define AUTORATE_INC_THRESHOLD  30
-
-/*+
- *
- * Description:
- *  Get RateIdx from the value in SuppRates IE or ExtSuppRates IE
- *
- * Parameters:
- *  In:
- *  unsigned char - Rate value in SuppRates IE or ExtSuppRates IE
- *  Out:
- *  none
- *
- * Return Value: RateIdx
- *
- -*/
-unsigned short
-wGetRateIdx(
-   unsigned char byRate
-)
-{
-   unsigned short ii;
-
-   /* Erase basicRate flag. */
-   byRate = byRate & 0x7F;/* 0111  */
-
-   for (ii = 0; i

[PATCH v2 19/48] staging: vt6655: dead code remove wpa/wpa2

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/80211mgr.c |  13 --
 drivers/staging/vt6655/Makefile   |   2 -
 drivers/staging/vt6655/vntwifi.c  |   7 -
 drivers/staging/vt6655/vntwifi.h  |   1 -
 drivers/staging/vt6655/wmgr.h |   2 -
 drivers/staging/vt6655/wpa.c  | 300 ---
 drivers/staging/vt6655/wpa.h  |  83 -
 drivers/staging/vt6655/wpa2.c | 359 --
 drivers/staging/vt6655/wpa2.h |  77 
 9 files changed, 844 deletions(-)
 delete mode 100644 drivers/staging/vt6655/wpa.c
 delete mode 100644 drivers/staging/vt6655/wpa.h
 delete mode 100644 drivers/staging/vt6655/wpa2.c
 delete mode 100644 drivers/staging/vt6655/wpa2.h

diff --git a/drivers/staging/vt6655/80211mgr.c 
b/drivers/staging/vt6655/80211mgr.c
index 7d2c647..22ded38 100644
--- a/drivers/staging/vt6655/80211mgr.c
+++ b/drivers/staging/vt6655/80211mgr.c
@@ -57,7 +57,6 @@
 #include "80211mgr.h"
 #include "80211hdr.h"
 #include "device.h"
-#include "wpa.h"
 
 /*-  Static Definitions -*/
 
@@ -171,9 +170,6 @@ vMgrDecodeBeacon(
break;
case WLAN_EID_RSN_WPA:
if (pFrame->pRSNWPA == NULL) {
-   if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == 
true)
-   pFrame->pRSNWPA =
-  (PWLAN_IE_RSN_EXT)pItem;
}
break;
 
@@ -389,9 +385,6 @@ vMgrDecodeAssocRequest(
break;
case WLAN_EID_RSN_WPA:
if (pFrame->pRSNWPA == NULL) {
-   if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == 
true)
-   pFrame->pRSNWPA =
-  (PWLAN_IE_RSN_EXT)pItem;
}
break;
case WLAN_EID_EXTSUPP_RATES:
@@ -574,9 +567,6 @@ vMgrDecodeReassocRequest(
break;
case WLAN_EID_RSN_WPA:
if (pFrame->pRSNWPA == NULL) {
-   if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == 
true)
-   pFrame->pRSNWPA =
-  (PWLAN_IE_RSN_EXT)pItem;
}
break;
 
@@ -767,9 +757,6 @@ vMgrDecodeProbeResponse(
break;
case WLAN_EID_RSN_WPA:
if (pFrame->pRSNWPA == NULL) {
-   if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == 
true)
-   pFrame->pRSNWPA =
-  (PWLAN_IE_RSN_EXT)pItem;
}
break;
case WLAN_EID_ERP:
diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index e5ea1ea..7286e32 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -17,12 +17,10 @@ vt6655_stage-y +=   device_main.o \
rc4.o \
tether.o \
tcrc.o \
-   wpa.o \
key.o \
tkip.o \
michael.o \
rf.o \
-   wpa2.o \
aes_ccmp.o \
vntwifi.o
 
diff --git a/drivers/staging/vt6655/vntwifi.c b/drivers/staging/vt6655/vntwifi.c
index a5eccf7..54c65fc 100644
--- a/drivers/staging/vt6655/vntwifi.c
+++ b/drivers/staging/vt6655/vntwifi.c
@@ -557,13 +557,6 @@ VNTWIFIbSetPMKIDCache(
void *pPMKIDInfo
 )
 {
-   PSMgmtObjectpMgmt = (PSMgmtObject) pMgmtObject;
-
-   if (ulCount > MAX_PMKID_CACHE)
-   return false;
-
-   pMgmt->gsPMKIDCache.BSSIDInfoCount = ulCount;
-   memcpy(pMgmt->gsPMKIDCache.BSSIDInfo, pPMKIDInfo, 
(ulCount*sizeof(PMKIDInfo)));
return true;
 }
 
diff --git a/drivers/staging/vt6655/vntwifi.h b/drivers/staging/vt6655/vntwifi.h
index 880b8ab..9db734f 100644
--- a/drivers/staging/vt6655/vntwifi.h
+++ b/drivers/staging/vt6655/vntwifi.h
@@ -33,7 +33,6 @@
 #include "ttype.h"
 #include "80211mgr.h"
 #include "card.h"
-#include "wpa2.h"
 
 /*-  Export Definitions -*/
 #define RATE_1M 0
diff --git a/drivers/staging/vt6655/wmgr.h b/drivers/staging/vt6655/wmgr.h
index 4b7196b..7df62bb 100644
--- a/drivers/staging/vt6655/wmgr.h
+++ b/drivers/staging/vt6655/wmgr.h
@@ -39,7 +39,6 @@
 #include "80211hdr.h"
 #include "wcmd.h"
 #include "bssdb.h"
-#include "wpa2.h"
 #include "vntwifi.h"
 #include "card.h"
 
@@ -291,7 +290,6 @@ typedef struct tagSMgmtObject {
KnownNodeDB sNodeDBTable[MAX_NODE_NUM + 1];
 
// WPA2 PMKID Cache
-   SPMKIDCache gsPMKIDCache;
bool bRoaming;
 
// rate fall back vars
diff --git a/drivers/staging/vt6655/wpa.c b/drivers/stag

[PATCH v2 07/48] staging: vt6655: dead code remove wpactl.c/h

2014-10-29 Thread Malcolm Priestley
All these functions are now dead.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |   1 -
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/wpactl.c  | 893 ---
 drivers/staging/vt6655/wpactl.h  |  64 ---
 4 files changed, 959 deletions(-)
 delete mode 100644 drivers/staging/vt6655/wpactl.c
 delete mode 100644 drivers/staging/vt6655/wpactl.h

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 2d53450..2cad0d0 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -27,7 +27,6 @@ vt6655_stage-y += device_main.o \
michael.o \
wroute.o \
rf.o \
-   wpactl.o \
wpa2.o \
aes_ccmp.o \
vntwifi.o \
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 3a90401..991a276 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -68,7 +68,6 @@
 #include "rxtx.h"
 #include "wroute.h"
 #include "bssdb.h"
-#include "wpactl.h"
 #include "dpc.h"
 #include "datarate.h"
 #include "rf.h"
diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
deleted file mode 100644
index cc39829..000
--- a/drivers/staging/vt6655/wpactl.c
+++ /dev/null
@@ -1,893 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: wpactl.c
- *
- * Purpose: handle wpa supplicant ioctl input/out functions
- *
- * Author: Lyndon Chen
- *
- * Date: Oct. 20, 2003
- *
- * Functions:
- *
- * Revision History:
- *
- */
-
-#include "wpactl.h"
-#include "key.h"
-#include "mac.h"
-#include "device.h"
-#include "wmgr.h"
-#include "iocmd.h"
-#include "iowpa.h"
-#include "rf.h"
-
-/*-  Static Definitions -*/
-
-#define VIAWGET_WPA_MAX_BUF_SIZE 1024
-
-static const int frequency_list[] = {
-   2412, 2417, 2422, 2427, 2432, 2437, 2442,
-   2447, 2452, 2457, 2462, 2467, 2472, 2484
-};
-/*-  Static Classes  */
-
-/*-  Static Functions  --*/
-
-/*-  Export Variables  --*/
-static void wpadev_setup(struct net_device *dev)
-{
-   dev->type   = ARPHRD_IEEE80211;
-   dev->hard_header_len= ETH_HLEN;
-   dev->mtu= 2048;
-   dev->addr_len   = ETH_ALEN;
-   dev->tx_queue_len   = 1000;
-
-   memset(dev->broadcast, 0xFF, ETH_ALEN);
-
-   dev->flags  = IFF_BROADCAST|IFF_MULTICAST;
-}
-
-/*
- * Description:
- *  register netdev for wpa supplicant daemon
- *
- * Parameters:
- *  In:
- *  pDevice -
- *  enable  -
- *  Out:
- *
- * Return Value:
- *
- */
-
-static int wpa_init_wpadev(struct vnt_private *pDevice)
-{
-   struct vnt_private *wpadev_priv;
-   struct net_device *dev = pDevice->dev;
-   int ret = 0;
-
-   pDevice->wpadev = alloc_netdev(sizeof(*wpadev_priv), "vntwpa",
-  NET_NAME_UNKNOWN, wpadev_setup);
-   if (pDevice->wpadev == NULL)
-   return -ENOMEM;
-
-   wpadev_priv = netdev_priv(pDevice->wpadev);
-   *wpadev_priv = *pDevice;
-   eth_hw_addr_inherit(pDevice->wpadev, dev);
-   pDevice->wpadev->base_addr = dev->base_addr;
-   pDevice->wpadev->irq = dev->irq;
-   pDevice->wpadev->mem_start = dev->mem_start;
-   pDevice->wpadev->mem_end = dev->mem_end;
-   ret = register_netdev(pDevice->wpadev);
-   if (ret) {
-   pr_debug("%s: register_netdev(WPA) failed!\n", dev->name);
-   free_netdev(pDevice->wpadev);
-   return -1;
-   }
-
-   if (pDevice->skb == NULL) {
-   pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
-   if (pDevice->skb == NULL)
-   return -ENOMEM;
-   }
-
-   pr_debug("%s: Registered netdev %s for WPA management\n",
-dev->name, pDevice->wpadev->name);
-
-   return 0;
-}
-
-/*
- * Description:
- *  unregister net_device (wpadev)
- *
- * Parameters:

[PATCH v2 18/48] staging: vt6655: deadcode remove wroute.c/h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |   1 -
 drivers/staging/vt6655/device_main.c |   1 -
 drivers/staging/vt6655/rxtx.c|   1 -
 drivers/staging/vt6655/wroute.c  | 177 ---
 drivers/staging/vt6655/wroute.h  |  45 -
 5 files changed, 225 deletions(-)
 delete mode 100644 drivers/staging/vt6655/wroute.c
 delete mode 100644 drivers/staging/vt6655/wroute.h

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 141c0c1..e5ea1ea 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -21,7 +21,6 @@ vt6655_stage-y += device_main.o \
key.o \
tkip.o \
michael.o \
-   wroute.o \
rf.o \
wpa2.o \
aes_ccmp.o \
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 848c258..18dad0c 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -66,7 +66,6 @@
 #include "iocmd.h"
 #include "tcrc.h"
 #include "rxtx.h"
-#include "wroute.h"
 #include "bssdb.h"
 #include "dpc.h"
 #include "rf.h"
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index c47042c..6ae8594 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -59,7 +59,6 @@
 #include "tkip.h"
 #include "tcrc.h"
 #include "wctl.h"
-#include "wroute.h"
 #include "rf.h"
 
 /*-  Static Definitions -*/
diff --git a/drivers/staging/vt6655/wroute.c b/drivers/staging/vt6655/wroute.c
deleted file mode 100644
index 430e944..000
--- a/drivers/staging/vt6655/wroute.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: wroute.c
- *
- * Purpose: handle WMAC frame relay & filtering
- *
- * Author: Lyndon Chen
- *
- * Date: May 20, 2003
- *
- * Functions:
- *  ROUTEbRelay - Relay packet
- *
- * Revision History:
- *
- */
-
-#include "mac.h"
-#include "tcrc.h"
-#include "rxtx.h"
-#include "wroute.h"
-#include "card.h"
-#include "baseband.h"
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Functions  --*/
-
-/*-  Export Variables  --*/
-
-/*
- * Description:
- *  Relay packet.  Return true if packet is copy to DMA1
- *
- * Parameters:
- *  In:
- *  pDevice -
- *  pbySkbData  - rx packet skb data
- *  Out:
- *  true, false
- *
- * Return Value: true if packet duplicate; otherwise false
- *
- */
-bool ROUTEbRelay(struct vnt_private *pDevice, unsigned char *pbySkbData,
-unsigned int uDataLen, unsigned int uNodeIndex)
-{
-   PSMgmtObjectpMgmt = pDevice->pMgmt;
-   PSTxDescpHeadTD, pLastTD;
-   unsigned int cbFrameBodySize;
-   unsigned int uMACfragNum = 0;
-   unsigned char byPktType;
-   bool bNeedEncryption = false;
-   SKeyItemSTempKey;
-   PSKeyItem   pTransmitKey = NULL;
-   unsigned int ii;
-   unsigned char *pbyBSSID;
-
-   if (AVAIL_TD(pDevice, TYPE_AC0DMA) <= 0) {
-   pr_debug("Relay can't allocate TD1..\n");
-   return false;
-   }
-
-   pHeadTD = pDevice->apCurrTD[TYPE_AC0DMA];
-
-   pHeadTD->m_td1TD1.byTCR = (TCR_EDP | TCR_STP);
-
-   memcpy(pDevice->sTxEthHeader.abyDstAddr, pbySkbData, ETH_HLEN);
-
-   cbFrameBodySize = uDataLen - ETH_HLEN;
-
-   if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN)
-   cbFrameBodySize += 8;
-
-   if (pDevice->bEncryptionEnable == true) {
-   bNeedEncryption = true;
-
-   /* get group key */
-   pbyBSSID = pDevice->abyBroadcastAddr;
-   if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID,
-   GROUP_KEY, &pTransmitKey) == false) {
-   pTransmitKey = NULL;
-   pr_debug("KEY is NULL. [%d]\n",
-pDevice->pMgmt->eCurrMode);
-   } else 

[PATCH v2 14/48] staging: vt6655: dead code remove bssdb.c

2014-10-29 Thread Malcolm Priestley
header will be removed later

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile  |1 -
 drivers/staging/vt6655/bssdb.c   | 1504 --
 drivers/staging/vt6655/bssdb.h   |  115 ---
 drivers/staging/vt6655/vntwifi.c |   16 -
 4 files changed, 1636 deletions(-)
 delete mode 100644 drivers/staging/vt6655/bssdb.c

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 271ca9d..2c0b7932 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -9,7 +9,6 @@ vt6655_stage-y +=   device_main.o \
baseband.o \
wctl.o \
80211mgr.o \
-   bssdb.o \
rxtx.o \
dpc.o \
power.o \
diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c
deleted file mode 100644
index abe38e1..000
--- a/drivers/staging/vt6655/bssdb.c
+++ /dev/null
@@ -1,1504 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * File: bssdb.c
- *
- * Purpose: Handles the Basic Service Set & Node Database functions
- *
- * Functions:
- *  BSSpSearchBSSList - Search known BSS list for Desire SSID or BSSID
- *  BSSvClearBSSList - Clear BSS List
- *  BSSbInsertToBSSList - Insert a BSS set into known BSS list
- *  BSSbUpdateToBSSList - Update BSS set in known BSS list
- *  BSSDBbIsSTAInNodeDB - Search Node DB table to find the index of 
matched DstAddr
- *  BSSvCreateOneNode - Allocate an Node for Node DB
- *  BSSvUpdateAPNode - Update AP Node content in Index 0 of KnownNodeDB
- *  BSSvSecondCallBack - One second timer callback function to update Node 
DB info & AP link status
- *  BSSvUpdateNodeTxCounter - Update Tx attemps, Tx failure counter in 
Node DB for auto-fall back rate control
- *
- * Revision History:
- *
- * Author: Lyndon Chen
- *
- * Date: July 17, 2002
- *
- */
-
-#include "ttype.h"
-#include "tmacro.h"
-#include "tether.h"
-#include "device.h"
-#include "80211hdr.h"
-#include "bssdb.h"
-#include "wmgr.h"
-#include "datarate.h"
-#include "desc.h"
-#include "wcmd.h"
-#include "wpa.h"
-#include "baseband.h"
-#include "rf.h"
-#include "card.h"
-#include "channel.h"
-#include "mac.h"
-#include "wpa2.h"
-#include "iowpa.h"
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Variables  --*/
-static const unsigned short awHWRetry0[5][5] = {
-   {RATE_18M, RATE_18M, RATE_12M, RATE_12M, RATE_12M},
-   {RATE_24M, RATE_24M, RATE_18M, RATE_12M, RATE_12M},
-   {RATE_36M, RATE_36M, RATE_24M, RATE_18M, RATE_18M},
-   {RATE_48M, RATE_48M, RATE_36M, RATE_24M, RATE_24M},
-   {RATE_54M, RATE_54M, RATE_48M, RATE_36M, RATE_36M}
-};
-static const unsigned short awHWRetry1[5][5] = {
-   {RATE_18M, RATE_18M, RATE_12M, RATE_6M, RATE_6M},
-   {RATE_24M, RATE_24M, RATE_18M, RATE_6M, RATE_6M},
-   {RATE_36M, RATE_36M, RATE_24M, RATE_12M, RATE_12M},
-   {RATE_48M, RATE_48M, RATE_24M, RATE_12M, RATE_12M},
-   {RATE_54M, RATE_54M, RATE_36M, RATE_18M, RATE_18M}
-};
-
-/*-  Static Functions  --*/
-
-void s_vCheckSensitivity(
-   void *hDeviceContext
-);
-
-#ifdef Calcu_LinkQual
-void s_uCalculateLinkQual(
-   void *hDeviceContext
-);
-#endif
-
-void s_vCheckPreEDThreshold(
-   void *hDeviceContext
-);
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
-/*+
- *
- * Routine Description:
- *Search known BSS list for Desire SSID or BSSID.
- *
- * Return Value:
- *PTR to KnownBSS or NULL
- *
- -*/
-
-PKnownBSS
-BSSpSearchBSSList(
-   void *hDeviceContext,
-   unsigned char *pbyDesireBSSID,
-   unsigned char *pbyDesireSSID,
-   CARD_PHY_TYPE  ePhyType
-)
-{
-   struct vnt_private *pDevice = hDeviceContext;
-   PSMgmtObjectpMgmt = pDevice->pMgmt;
-   unsigned char *pbyBSSID = NULL;
-   PWLAN_IE_SSID   pSSID = NULL;
-   PKnownBSS   pCurrBSS = NULL;
-   PKnownBSS   pSelect = NULL;
-   u

[PATCH v2 01/48] staging: vt6655: deadcode remove zone file operations and vntconfiguration.dat

2014-10-29 Thread Malcolm Priestley
These are now all handled by mac80211.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h |   2 -
 drivers/staging/vt6655/device_main.c| 113 +---
 drivers/staging/vt6655/vntconfiguration.dat |   1 -
 3 files changed, 3 insertions(+), 113 deletions(-)
 delete mode 100644 drivers/staging/vt6655/vntconfiguration.dat

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 17a36dc..214f73f 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -750,6 +750,4 @@ bool device_dma0_xmit(struct vnt_private *pDevice,
  struct sk_buff *skb, unsigned int uNodeIndex);
 bool device_alloc_frag_buf(struct vnt_private *pDevice,
   PSDeFragControlBlock pDeF);
-int Config_FileOperation(struct vnt_private *pDevice,
-bool fwrite, unsigned char *Parameter);
 #endif
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 07d2101..12fa63c 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -303,8 +303,6 @@ static void device_free_rd0_ring(struct vnt_private 
*pDevice);
 static void device_free_rd1_ring(struct vnt_private *pDevice);
 static void device_free_rings(struct vnt_private *pDevice);
 static void device_free_frag_buf(struct vnt_private *pDevice);
-static int Config_FileGetParameter(unsigned char *string,
-  unsigned char *dest, unsigned char *source);
 
 /*-  Export Variables  --*/
 
@@ -412,7 +410,6 @@ static void device_init_registers(struct vnt_private 
*pDevice)
unsigned char byValue1;
unsigned char byCCKPwrdBm = 0;
unsigned char byOFDMPwrdBm = 0;
-   int zonetype = 0;
 
MACbShutdown(pDevice->PortOffset);
BBvSoftwareReset(pDevice->PortOffset);
@@ -517,41 +514,6 @@ static void device_init_registers(struct vnt_private 
*pDevice)
 
/* zonetype initial */
pDevice->byOriginalZonetype = pDevice->abyEEPROM[EEP_OFS_ZONETYPE];
-   zonetype = Config_FileOperation(pDevice, false, NULL);
-
-   if (zonetype >= 0) {
-   if ((zonetype == 0) &&
-   (pDevice->abyEEPROM[EEP_OFS_ZONETYPE] != 0x00)) {
-   /* for USA */
-   pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0;
-   pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0B;
-
-   pr_debug("Init Zone Type :USA\n");
-   } else if ((zonetype == 1) &&
-(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] != 0x01)) {
-   /* for Japan */
-   pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0x01;
-   pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
-   } else if ((zonetype == 2) &&
- (pDevice->abyEEPROM[EEP_OFS_ZONETYPE] != 0x02)) {
-   /* for Europe */
-   pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0x02;
-   pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
-
-   pr_debug("Init Zone Type :Europe\n");
-   } else {
-   if (zonetype != pDevice->abyEEPROM[EEP_OFS_ZONETYPE])
-   pr_debug("zonetype in file[%02x] mismatch with 
in EEPROM[%02x]\n",
-zonetype,
-pDevice->abyEEPROM[EEP_OFS_ZONETYPE]);
-   else
-   pr_debug("Read Zonetype file success,use 
default zonetype setting[%02x]\n",
-zonetype);
-   }
-   } else {
-   pr_debug("Read Zonetype file fail,use default zonetype 
setting[%02x]\n",
-SROMbyReadEmbedded(pDevice->PortOffset, 
EEP_OFS_ZONETYPE));
-   }
 
/* Get RFType */
pDevice->byRFType = SROMbyReadEmbedded(pDevice->PortOffset, 
EEP_OFS_RFTYPE);
@@ -595,14 +557,9 @@ static void device_init_registers(struct vnt_private 
*pDevice)
}
 
/* recover 12,13 ,14channel for EUROPE by 11 channel */
-   if (((pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Japan) ||
-(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Europe)) &&
-   (pDevice->byOriginalZonetype == ZoneType_USA)) {
-   for (ii = 11; ii < 14; ii++) {
-   pDevice->abyCCKPwrTbl[ii] = pDevice->abyCCKPwrTbl[10];
-   pDevice->abyOFDMPwrTbl[ii] = pDevice->abyOFDMPwrTbl[10];
-
-   }
+   for (ii = 11; ii < 14; ii++) {
+   pDevice->abyCCKPwrTbl[ii] = pDevice->abyCCKPwrTbl[10];
+   pDevice->abyOFDMPwrTbl[ii] = pDevice->abyOFDMPwrTbl[10];
}
 
/* Load OFDM A Power Table */
@@ -2139,70 +2096,6 @@ static  irqreturn_t  device_intr(

[PATCH v2 02/48] staging: vt6655: dead code remove zones and channel table elements

2014-10-29 Thread Malcolm Priestley
emply functions will be deleted later

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/channel.c | 605 +--
 drivers/staging/vt6655/channel.h |   8 -
 2 files changed, 2 insertions(+), 611 deletions(-)

diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c
index 2379696..a7b39d4 100644
--- a/drivers/staging/vt6655/channel.c
+++ b/drivers/staging/vt6655/channel.c
@@ -26,332 +26,6 @@
 #include "device.h"
 #include "rf.h"
 
-/*-  Static Definitions -*/
-
-#define CARD_MAX_CHANNEL_TBL56
-
-/*-  Static Variables  --*/
-
-static SChannelTblElement sChannelTbl[CARD_MAX_CHANNEL_TBL + 1] =
-{
-   {0,   0,false,0},
-   {1,   2412, true, 0},
-   {2,   2417, true, 0},
-   {3,   2422, true, 0},
-   {4,   2427, true, 0},
-   {5,   2432, true, 0},
-   {6,   2437, true, 0},
-   {7,   2442, true, 0},
-   {8,   2447, true, 0},
-   {9,   2452, true, 0},
-   {10,  2457, true, 0},
-   {11,  2462, true, 0},
-   {12,  2467, true, 0},
-   {13,  2472, true, 0},
-   {14,  2484, true, 0},
-   {183, 4915, true, 0},
-   {184, 4920, true, 0},
-   {185, 4925, true, 0},
-   {187, 4935, true, 0},
-   {188, 4940, true, 0},
-   {189, 4945, true, 0},
-   {192, 4960, true, 0},
-   {196, 4980, true, 0},
-   {7,   5035, true, 0},
-   {8,   5040, true, 0},
-   {9,   5045, true, 0},
-   {11,  5055, true, 0},
-   {12,  5060, true, 0},
-   {16,  5080, true, 0},
-   {34,  5170, true, 0},
-   {36,  5180, true, 0},
-   {38,  5190, true, 0},
-   {40,  5200, true, 0},
-   {42,  5210, true, 0},
-   {44,  5220, true, 0},
-   {46,  5230, true, 0},
-   {48,  5240, true, 0},
-   {52,  5260, true, 0},
-   {56,  5280, true, 0},
-   {60,  5300, true, 0},
-   {64,  5320, true, 0},
-   {100, 5500, true, 0},
-   {104, 5520, true, 0},
-   {108, 5540, true, 0},
-   {112, 5560, true, 0},
-   {116, 5580, true, 0},
-   {120, 5600, true, 0},
-   {124, 5620, true, 0},
-   {128, 5640, true, 0},
-   {132, 5660, true, 0},
-   {136, 5680, true, 0},
-   {140, 5700, true, 0},
-   {149, 5745, true, 0},
-   {153, 5765, true, 0},
-   {157, 5785, true, 0},
-   {161, 5805, true, 0},
-   {165, 5825, true, 0}
-};
-
-/
- * The Radar regulation rules for each country
- /
-static struct
-{
-   unsigned char byChannelCountryCode; /* The country code 
*/
-   char chCountryCode[2];
-   unsigned char bChannelIdxList[CB_MAX_CHANNEL];  /* Available channels 
Index */
-   unsigned char byPower[CB_MAX_CHANNEL];
-} ChannelRuleTab[] =
-{
-/
- * This table is based on Athero driver rules
- /
-/* Country  Available channels, ended with 0*/
-/*  1   2   3   4   5   6   7   8  
 9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  
29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  
49  50  51  52  53  54  55  56  */
-   {CCODE_FCC, {'U' , 'S'},  {   1,  1,  1,  1,  1,  
1,  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  
0,  0,  0,  0,  1,  0,  1,  0,  1,  0,  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,  
0,  0,  0,  0,  0,  0,  1,  1,  1,  1,  1}
-,  {  27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,  0,  0,  0,  0,  0,  
0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 17,  0, 17,  0, 17,  0, 17, 
23, 23, 23, 23,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 30, 30, 30, 30, 30} 
 },
-   {CCODE_TELEC,   {'J' , 'P'},  {   1,  1,  1,  1,  1,  
1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  1,  0,  0,  1,  0,  1,  1,  0,  1,  0,  
0,  1,  1,  1,  0,  1,  0,  1,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  
0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0}
-,  {  20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,  0, 23,  
0,  0, 23,  0, 23, 23,  0, 23,  0,  0, 23, 23, 23,  0, 23,  0, 23,  0, 23,  0,  
0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0}  
},
-   {CCODE_ETSI,{'E' , 'U'},  {   1,  1,  1,  1,  1,  
1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  
0,  0,  0,  0,  1,  0,  1,  0

[PATCH v2 20/48] staging: vt6655: deadcode remove aes_ccmp/rc4/tkip

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Makefile   |   3 -
 drivers/staging/vt6655/aes_ccmp.c | 374 --
 drivers/staging/vt6655/aes_ccmp.h |  37 
 drivers/staging/vt6655/device.h   |   2 -
 drivers/staging/vt6655/rc4.c  |  88 -
 drivers/staging/vt6655/rc4.h  |  47 -
 drivers/staging/vt6655/rxtx.c |   1 -
 drivers/staging/vt6655/tkip.c | 268 ---
 drivers/staging/vt6655/tkip.h |  57 --
 9 files changed, 877 deletions(-)
 delete mode 100644 drivers/staging/vt6655/aes_ccmp.c
 delete mode 100644 drivers/staging/vt6655/aes_ccmp.h
 delete mode 100644 drivers/staging/vt6655/rc4.c
 delete mode 100644 drivers/staging/vt6655/rc4.h
 delete mode 100644 drivers/staging/vt6655/tkip.c
 delete mode 100644 drivers/staging/vt6655/tkip.h

diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 7286e32..f49f12b 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -14,14 +14,11 @@ vt6655_stage-y +=   device_main.o \
power.o \
srom.o \
mib.o \
-   rc4.o \
tether.o \
tcrc.o \
key.o \
-   tkip.o \
michael.o \
rf.o \
-   aes_ccmp.o \
vntwifi.o
 
 obj-$(CONFIG_VT6655) +=vt6655_stage.o
diff --git a/drivers/staging/vt6655/aes_ccmp.c 
b/drivers/staging/vt6655/aes_ccmp.c
deleted file mode 100644
index 1dfcfcb..000
--- a/drivers/staging/vt6655/aes_ccmp.c
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: aes_ccmp.c
- *
- * Purpose: AES_CCMP decryption
- *
- * Author: Warren Hsu
- *
- * Date: Feb 15, 2005
- *
- * Functions:
- *  AESbGenCCMP - Parsing RX-packet
- *
- *
- * Revision History:
- *
- */
-
-#include "device.h"
-#include "80211hdr.h"
-#include "aes_ccmp.h"
-
-/*-  Static Definitions -*/
-
-/*-  Static Classes  */
-
-/*-  Static Variables  --*/
-
-/*
- * SBOX Table
- */
-
-static unsigned char sbox_table[256] = {
-   0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 
0xfe, 0xd7, 0xab, 0x76,
-   0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 
0x9c, 0xa4, 0x72, 0xc0,
-   0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 
0x71, 0xd8, 0x31, 0x15,
-   0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 
0xeb, 0x27, 0xb2, 0x75,
-   0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 
0x29, 0xe3, 0x2f, 0x84,
-   0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 
0x4a, 0x4c, 0x58, 0xcf,
-   0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 
0x50, 0x3c, 0x9f, 0xa8,
-   0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 
0x10, 0xff, 0xf3, 0xd2,
-   0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 
0x64, 0x5d, 0x19, 0x73,
-   0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 
0xde, 0x5e, 0x0b, 0xdb,
-   0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 
0x91, 0x95, 0xe4, 0x79,
-   0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 
0x65, 0x7a, 0xae, 0x08,
-   0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 
0x4b, 0xbd, 0x8b, 0x8a,
-   0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 
0x86, 0xc1, 0x1d, 0x9e,
-   0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 
0xce, 0x55, 0x28, 0xdf,
-   0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 
0xb0, 0x54, 0xbb, 0x16
-};
-
-static unsigned char dot2_table[256] = {
-   0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 
0x18, 0x1a, 0x1c, 0x1e,
-   0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 
0x38, 0x3a, 0x3c, 0x3e,
-   0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 
0x58, 0x5a, 0x5c, 

[PATCH v2 09/48] staging: vt6655: remove dead functions in power.c/h

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/power.c | 171 -
 drivers/staging/vt6655/power.h |  16 
 drivers/staging/vt6655/wcmd.c  |   2 -
 drivers/staging/vt6655/wmgr.c  |   6 --
 4 files changed, 195 deletions(-)

diff --git a/drivers/staging/vt6655/power.c b/drivers/staging/vt6655/power.c
index 5371802..040484e 100644
--- a/drivers/staging/vt6655/power.c
+++ b/drivers/staging/vt6655/power.c
@@ -43,7 +43,6 @@
 #include "wmgr.h"
 #include "power.h"
 #include "wcmd.h"
-#include "rxtx.h"
 #include "card.h"
 
 /*-  Static Definitions -*/
@@ -140,176 +139,6 @@ PSvDisablePowerSaving(
pDevice->bPWBitOn = false;
 }
 
-/*+
- *
- * Routine Description:
- * Consider to power down when no more packets to tx or rx.
- *
- * Return Value:
- *true, if power down success
- *false, if fail
- -*/
-
-bool
-PSbConsiderPowerDown(
-   void *hDeviceContext,
-   bool bCheckRxDMA,
-   bool bCheckCountToWakeUp
-)
-{
-   struct vnt_private *pDevice = hDeviceContext;
-   PSMgmtObjectpMgmt = pDevice->pMgmt;
-   unsigned int uIdx;
-
-   // check if already in Doze mode
-   if (MACbIsRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PS))
-   return true;
-
-   if (pMgmt->eCurrMode != WMAC_MODE_IBSS_STA) {
-   // check if in TIM wake period
-   if (pMgmt->bInTIMWake)
-   return false;
-   }
-
-   // check scan state
-   if (pDevice->bCmdRunning)
-   return false;
-
-   // Force PSEN on
-   MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PSEN);
-
-   // check if all TD are empty,
-   for (uIdx = 0; uIdx < TYPE_MAXTD; uIdx++) {
-   if (pDevice->iTDUsed[uIdx] != 0)
-   return false;
-   }
-
-   // check if rx isr is clear
-   if (bCheckRxDMA &&
-   ((pDevice->dwIsr & ISR_RXDMA0) != 0) &&
-   ((pDevice->dwIsr & ISR_RXDMA1) != 0)) {
-   return false;
-   }
-
-   if (pMgmt->eCurrMode != WMAC_MODE_IBSS_STA) {
-   if (bCheckCountToWakeUp &&
-   (pMgmt->wCountToWakeUp == 0 || pMgmt->wCountToWakeUp == 1)) 
{
-   return false;
-   }
-   }
-
-   // no Tx, no Rx isr, now go to Doze
-   MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_GO2DOZE);
-   pr_debug("Go to Doze ZZZ\n");
-   return true;
-}
-
-/*+
- *
- * Routine Description:
- * Send PS-POLL packet
- *
- * Return Value:
- *None.
- *
- -*/
-
-void
-PSvSendPSPOLL(
-   void *hDeviceContext
-)
-{
-   struct vnt_private *pDevice = hDeviceContext;
-   PSMgmtObjectpMgmt = pDevice->pMgmt;
-   PSTxMgmtPacket  pTxPacket = NULL;
-
-   memset(pMgmt->pbyPSPacketPool, 0, sizeof(STxMgmtPacket) + 
WLAN_HDR_ADDR2_LEN);
-   pTxPacket = (PSTxMgmtPacket)pMgmt->pbyPSPacketPool;
-   pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket 
+ sizeof(STxMgmtPacket));
-   pTxPacket->p80211Header->sA2.wFrameCtl = cpu_to_le16(
-   (
-   WLAN_SET_FC_FTYPE(WLAN_TYPE_CTL) |
-   WLAN_SET_FC_FSTYPE(WLAN_FSTYPE_PSPOLL) |
-   WLAN_SET_FC_PWRMGT(0)
-));
-   pTxPacket->p80211Header->sA2.wDurationID = pMgmt->wCurrAID | BIT14 | 
BIT15;
-   memcpy(pTxPacket->p80211Header->sA2.abyAddr1, pMgmt->abyCurrBSSID, 
WLAN_ADDR_LEN);
-   memcpy(pTxPacket->p80211Header->sA2.abyAddr2, pMgmt->abyMACAddr, 
WLAN_ADDR_LEN);
-   pTxPacket->cbMPDULen = WLAN_HDR_ADDR2_LEN;
-   pTxPacket->cbPayloadLen = 0;
-   // send the frame
-   if (csMgmt_xmit(pDevice, pTxPacket) != CMD_STATUS_PENDING)
-   pr_debug("Send PS-Poll packet failed..\n");
-}
-
-/*+
- *
- * Routine Description:
- * Send NULL packet to AP for notification power state of STA
- *
- * Return Value:
- *None.
- *
- -*/
-bool
-PSbSendNullPacket(
-   void *hDeviceContext
-)
-{
-   struct vnt_private *pDevice = hDeviceContext;
-   PSTxMgmtPacket  pTxPacket = NULL;
-   PSMgmtObjectpMgmt = pDevice->pMgmt;
-   unsigned int uIdx;
-
-   if (!pDevice->bLinkPass)
-   return false;
-
-   if (!pDevice->bEnablePSMode && !pDevice->fTxDataInSleep)
-   return false;
-
-   if (pDevice->bEnablePSMode) {
-   for (uIdx = 0; uIdx < TYPE_MAXTD; uIdx++) {
-   if (pDevice->iTDUsed[uIdx] != 0)
-   return false;
-   }
-   }
-
-   memset(pMgmt->pbyPSPacketPool, 0, sizeof(STxMgmtPacket) + 
WLAN_NULLDATA_FR_MAXLEN);
-   pTxPacket = (PSTxMgmtPacket)pMgmt->pbyPSPacketPool;
-   pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket 
+ sizeof(STxMgmtPacket));
-
-   if (pDevice->bEnablePSMode) {
-   pTxPacket->p80211Header->sA3.w

[PATCH v2 15/34] staging: vt6655: mac80211 conversion: enable power saving

2014-10-29 Thread Malcolm Priestley
Convert PSvEnablePowerSaving and PSvEnablePowerSaving

Remove mgmt->wCurrAID and use pDevice->current_aid

We nolonger send the PSbSendNullPacket.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/power.c | 15 +++
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/vt6655/power.c b/drivers/staging/vt6655/power.c
index 08241b9..fe33bb2 100644
--- a/drivers/staging/vt6655/power.c
+++ b/drivers/staging/vt6655/power.c
@@ -73,8 +73,7 @@ PSvEnablePowerSaving(
 )
 {
struct vnt_private *pDevice = hDeviceContext;
-   PSMgmtObjectpMgmt = pDevice->pMgmt;
-   unsigned short wAID = pMgmt->wCurrAID | BIT14 | BIT15;
+   u16 wAID = pDevice->current_aid | BIT(14) | BIT(15);
 
// set period of power up before TBTT
VNSvOutPortW(pDevice->PortOffset + MAC_REG_PWBT, C_PWBT);
@@ -83,7 +82,9 @@ PSvEnablePowerSaving(
VNSvOutPortW(pDevice->PortOffset + MAC_REG_AIDATIM, wAID);
} else {
// set ATIM Window
+#if 0 /* TODO atim window */
MACvWriteATIMW(pDevice->PortOffset, pMgmt->wCurrATIMWindow);
+#endif
}
// Set AutoSleep
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCFG, PSCFG_AUTOSLEEP);
@@ -95,22 +96,15 @@ PSvEnablePowerSaving(
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_ALBCN);
// first time set listen next beacon
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_LNBCN);
-   pMgmt->wCountToWakeUp = wListenInterval;
} else {
// always listen beacon
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_ALBCN);
-   pMgmt->wCountToWakeUp = 0;
}
 
// enable power saving hw function
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PSEN);
pDevice->bEnablePSMode = true;
 
-   /* We don't send null pkt in ad hoc mode since beacon will handle this. 
*/
-   if (pDevice->op_mode != NL80211_IFTYPE_ADHOC &&
-   pDevice->op_mode == NL80211_IFTYPE_STATION)
-   PSbSendNullPacket(pDevice);
-
pDevice->bPWBitOn = true;
pr_debug("PS:Power Saving Mode Enable...\n");
 }
@@ -143,9 +137,6 @@ PSvDisablePowerSaving(
 
pDevice->bEnablePSMode = false;
 
-   if (pDevice->op_mode == NL80211_IFTYPE_STATION)
-   PSbSendNullPacket(pDevice);
-
pDevice->bPWBitOn = false;
 }
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 18/34] staging: vt6655: CARDbSetPhyParameter replace s_vSetRSPINF with CARDvSetRSPINF

2014-10-29 Thread Malcolm Priestley
Removing s_vSetRSPINF

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/card.c | 120 +-
 1 file changed, 1 insertion(+), 119 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index a1330bc..72896c1 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -198,124 +198,6 @@ s_vCalculateOFDMRParameter(
}
 }
 
-/*
- * Description: Set RSPINF
- *
- * Parameters:
- *  In:
- *  pDevice - The adapter to be set
- *  Out:
- *  none
- *
- * Return Value: None.
- */
-static
-void
-s_vSetRSPINF(struct vnt_private *pDevice, CARD_PHY_TYPE ePHYType,
-void *pvSupportRateIEs, void *pvExtSupportRateIEs)
-{
-   union vnt_phy_field_swap phy;
-   unsigned char byTxRate = 0, byRsvTime = 0;/* For OFDM */
-
-   /* Set to Page1 */
-   MACvSelectPage1(pDevice->PortOffset);
-
-   /* RSPINF_b_1 */
-   vnt_get_phy_field(pDevice,
- 14,
- VNTWIFIbyGetACKTxRate(RATE_1M, pvSupportRateIEs, 
pvExtSupportRateIEs),
- PK_TYPE_11B,
- &phy.field_read);
-
-/* swap over to get correct write order */
-   swap(phy.swap[0], phy.swap[1]);
-
-   VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_1, phy.field_write);
-
-   /* RSPINF_b_2 */
-   vnt_get_phy_field(pDevice, 14,
- VNTWIFIbyGetACKTxRate(RATE_2M, pvSupportRateIEs, 
pvExtSupportRateIEs),
- PK_TYPE_11B, &phy.field_read);
-
-   swap(phy.swap[0], phy.swap[1]);
-
-   VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_2, phy.field_write);
-
-   /* RSPINF_b_5 */
-   vnt_get_phy_field(pDevice, 14,
- VNTWIFIbyGetACKTxRate(RATE_5M, pvSupportRateIEs, 
pvExtSupportRateIEs),
- PK_TYPE_11B, &phy.field_read);
-
-   swap(phy.swap[0], phy.swap[1]);
-
-   VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_5, phy.field_write);
-
-   /* RSPINF_b_11 */
-   vnt_get_phy_field(pDevice, 14,
- VNTWIFIbyGetACKTxRate(RATE_11M, pvSupportRateIEs, 
pvExtSupportRateIEs),
- PK_TYPE_11B, &phy.field_read);
-
-   swap(phy.swap[0], phy.swap[1]);
-
-   VNSvOutPortD(pDevice->PortOffset + MAC_REG_RSPINF_B_11, 
phy.field_write);
-
-   /* RSPINF_a_6 */
-   s_vCalculateOFDMRParameter(RATE_6M,
-  ePHYType,
-  &byTxRate,
-  &byRsvTime);
-   VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_6, 
MAKEWORD(byTxRate, byRsvTime));
-   /* RSPINF_a_9 */
-   s_vCalculateOFDMRParameter(RATE_9M,
-  ePHYType,
-  &byTxRate,
-  &byRsvTime);
-   VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_9, 
MAKEWORD(byTxRate, byRsvTime));
-   /* RSPINF_a_12 */
-   s_vCalculateOFDMRParameter(RATE_12M,
-  ePHYType,
-  &byTxRate,
-  &byRsvTime);
-   VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_12, 
MAKEWORD(byTxRate, byRsvTime));
-   /* RSPINF_a_18 */
-   s_vCalculateOFDMRParameter(RATE_18M,
-  ePHYType,
-  &byTxRate,
-  &byRsvTime);
-   VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_18, 
MAKEWORD(byTxRate, byRsvTime));
-   /* RSPINF_a_24 */
-   s_vCalculateOFDMRParameter(RATE_24M,
-  ePHYType,
-  &byTxRate,
-  &byRsvTime);
-   VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_24, 
MAKEWORD(byTxRate, byRsvTime));
-   /* RSPINF_a_36 */
-   s_vCalculateOFDMRParameter(
-   VNTWIFIbyGetACKTxRate(RATE_36M, pvSupportRateIEs, 
pvExtSupportRateIEs),
-   ePHYType,
-   &byTxRate,
-   &byRsvTime);
-   VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_36, 
MAKEWORD(byTxRate, byRsvTime));
-   /* RSPINF_a_48 */
-   s_vCalculateOFDMRParameter(
-   VNTWIFIbyGetACKTxRate(RATE_48M, pvSupportRateIEs, 
pvExtSupportRateIEs),
-   ePHYType,
-   &byTxRate,
-   &byRsvTime);
-   VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_48, 
MAKEWORD(byTxRate, byRsvTime));
-   /* RSPINF_a_54 */
-   s_vCalculateOFDMRParameter(
-   VNTWIFIbyGetACKTxRate(RATE_54M, pvSupportRateIEs, 
pvExtSupportRateIEs),
-   ePHYType,
-   &byTxRate,
-   &byRsvTime);
-   VNSvOutPortW(pDevice->PortOffset + MAC_REG_RSPINF_A_54, 
MAKEWORD(byTxRate, byRsvTime));
-   /* RSPINF_a_72 */
-   VNSvOutPortW(pDev

[PATCH v2 14/34] staging: vt6655: mac80211 conversion: changes to set channel

2014-10-29 Thread Malcolm Priestley
Remove call to sChannelTbl, the channel under mac80211 is always valid.

CARDbSetPhyParameter is nolonger set here.

RFbSetPower is now set on byBBType

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/channel.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c
index 4b3c798..2379696 100644
--- a/drivers/staging/vt6655/channel.c
+++ b/drivers/staging/vt6655/channel.c
@@ -665,16 +665,6 @@ bool set_channel(void *pDeviceHandler, unsigned int 
uConnectionChannel)
if (pDevice->byCurrentCh == uConnectionChannel)
return bResult;
 
-   if (!sChannelTbl[uConnectionChannel].bValid)
-   return false;
-
-   if ((uConnectionChannel > CB_MAX_CHANNEL_24G) &&
-   (pDevice->eCurrentPHYType != PHY_TYPE_11A)) {
-   CARDbSetPhyParameter(pDevice, PHY_TYPE_11A, 0, 0, NULL, NULL);
-   } else if ((uConnectionChannel <= CB_MAX_CHANNEL_24G) &&
-  (pDevice->eCurrentPHYType == PHY_TYPE_11A)) {
-   CARDbSetPhyParameter(pDevice, PHY_TYPE_11G, 0, 0, NULL, NULL);
-   }
/* clear NAV */
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_MACCR, MACCR_CLRNAV);
 
@@ -702,7 +692,7 @@ bool set_channel(void *pDeviceHandler, unsigned int 
uConnectionChannel)
MACvSelectPage0(pDevice->PortOffset);
}
 
-   if (pDevice->eCurrentPHYType == PHY_TYPE_11B)
+   if (pDevice->byBBType == BB_TYPE_11B)
RFbSetPower(pDevice, RATE_1M, pDevice->byCurrentCh);
else
RFbSetPower(pDevice, RATE_6M, pDevice->byCurrentCh);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 17/34] staging: vt6655: mac80211 conversion: card.c use basic_rates

2014-10-29 Thread Malcolm Priestley
Use basic_rates to find cck and ofdm rates.

wBasicRate will be removed later.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/card.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 090c286..a1330bc 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -1457,7 +1457,7 @@ static unsigned short CARDwGetCCKControlRate(struct 
vnt_private *pDevice,
unsigned int ui = (unsigned int) wRateIdx;
 
while (ui > RATE_1M) {
-   if (pDevice->wBasicRate & ((unsigned short)1 << ui))
+   if (pDevice->basic_rates & ((u32)0x1 << ui))
return (unsigned short)ui;
 
ui--;
@@ -1482,7 +1482,7 @@ static unsigned short CARDwGetOFDMControlRate(struct 
vnt_private *pDevice,
 {
unsigned int ui = (unsigned int) wRateIdx;
 
-   pr_debug("BASIC RATE: %X\n", pDevice->wBasicRate);
+   pr_debug("BASIC RATE: %X\n", pDevice->basic_rates);
 
if (!CARDbIsOFDMinBasicRate((void *)pDevice)) {
pr_debug("CARDwGetOFDMControlRate:(NO OFDM) %d\n", wRateIdx);
@@ -1491,7 +1491,7 @@ static unsigned short CARDwGetOFDMControlRate(struct 
vnt_private *pDevice,
return wRateIdx;
}
while (ui > RATE_11M) {
-   if (pDevice->wBasicRate & ((unsigned short)1 << ui)) {
+   if (pDevice->basic_rates & ((u32)0x1 << ui)) {
pr_debug("CARDwGetOFDMControlRate : %d\n", ui);
return (unsigned short)ui;
}
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 16/34] staging: vt6655: mac80211 conversion: changes to CARDbSetPhyParameter

2014-10-29 Thread Malcolm Priestley
CARDbSetPhyParameter appears to use two different strutures to find supported
rates.

Remove PWLAN_IE_SUPP_RATES and use basic_rates to find rates supported.

mac80211 now sets bShortSlotTime, bBarkerPreambleMd and byPreambleType remove
these.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/card.c | 61 ---
 1 file changed, 11 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index eae6789..090c286 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -74,15 +74,6 @@
 
 #define WAIT_BEACON_TX_DOWN_TMO 3/* Times */
 
-/* 1M,   2M,   5M,  11M,  18M,  24M,  36M,  54M */
-static unsigned char abyDefaultSuppRatesG[] = {WLAN_EID_SUPP_RATES, 8, 0x02, 
0x04, 0x0B, 0x16, 0x24, 0x30, 0x48, 0x6C};
-/* 6M,  9M,  12M,  48M */
-static unsigned char abyDefaultExtSuppRatesG[] = {WLAN_EID_EXTSUPP_RATES, 4, 
0x0C, 0x12, 0x18, 0x60};
-/* 6M,  9M,  12M,  18M,  24M,  36M,  48M,  54M */
-static unsigned char abyDefaultSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 
0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C};
-/* 1M,   2M,   5M,  11M, */
-static unsigned char abyDefaultSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 
0x04, 0x0B, 0x16};
-
 /*-  Static Variables  --*/
 
 static const unsigned short cwRXBCNTSFOff[MAX_RATE] =
@@ -384,14 +375,10 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, 
CARD_PHY_TYPE ePHYType,
unsigned char bySIFS = 0;
unsigned char byDIFS = 0;
unsigned char byData;
-   PWLAN_IE_SUPP_RATES pSupportRates = (PWLAN_IE_SUPP_RATES) 
pvSupportRateIEs;
-   PWLAN_IE_SUPP_RATES pExtSupportRates = (PWLAN_IE_SUPP_RATES) 
pvExtSupportRateIEs;
+   int i;
 
/* Set SIFS, DIFS, EIFS, SlotTime, CwMin */
if (ePHYType == PHY_TYPE_11A) {
-   if (pSupportRates == NULL)
-   pSupportRates = (PWLAN_IE_SUPP_RATES) 
abyDefaultSuppRatesA;
-
if (pDevice->byRFType == RF_AIROHA7230) {
/* AL7230 use single PAPE and connect to PAPE_2.4G */
MACvSetBBType(pDevice->PortOffset, BB_TYPE_11G);
@@ -419,9 +406,6 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, 
CARD_PHY_TYPE ePHYType,
byDIFS = C_SIFS_A + 2*C_SLOT_SHORT;
byCWMaxMin = 0xA4;
} else if (ePHYType == PHY_TYPE_11B) {
-   if (pSupportRates == NULL)
-   pSupportRates = (PWLAN_IE_SUPP_RATES) 
abyDefaultSuppRatesB;
-
MACvSetBBType(pDevice->PortOffset, BB_TYPE_11B);
if (pDevice->byRFType == RF_AIROHA7230) {
pDevice->abyBBVGA[0] = 0x1C;
@@ -445,10 +429,6 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, 
CARD_PHY_TYPE ePHYType,
byDIFS = C_SIFS_BG + 2*C_SLOT_LONG;
byCWMaxMin = 0xA5;
} else { /* PK_TYPE_11GA & PK_TYPE_11GB */
-   if (pSupportRates == NULL) {
-   pSupportRates = (PWLAN_IE_SUPP_RATES) 
abyDefaultSuppRatesG;
-   pExtSupportRates = (PWLAN_IE_SUPP_RATES) 
abyDefaultExtSuppRatesG;
-   }
MACvSetBBType(pDevice->PortOffset, BB_TYPE_11G);
if (pDevice->byRFType == RF_AIROHA7230) {
pDevice->abyBBVGA[0] = 0x1C;
@@ -468,32 +448,22 @@ bool CARDbSetPhyParameter(struct vnt_private *pDevice, 
CARD_PHY_TYPE ePHYType,
}
BBbWriteEmbedded(pDevice->PortOffset, 0x88, 0x08);
bySIFS = C_SIFS_BG;
-   if (VNTWIFIbIsShortSlotTime(wCapInfo)) {
+
+   if (pDevice->bShortSlotTime) {
bySlot = C_SLOT_SHORT;
byDIFS = C_SIFS_BG + 2*C_SLOT_SHORT;
} else {
bySlot = C_SLOT_LONG;
byDIFS = C_SIFS_BG + 2*C_SLOT_LONG;
}
-   if (VNTWIFIbyGetMaxSupportRate(pSupportRates, pExtSupportRates) 
> RATE_11M)
-   byCWMaxMin = 0xA4;
-   else
-   byCWMaxMin = 0xA5;
 
-   if (pDevice->bProtectMode != VNTWIFIbIsProtectMode(byERPField)) 
{
-   pDevice->bProtectMode = 
VNTWIFIbIsProtectMode(byERPField);
-   if (pDevice->bProtectMode)
-   MACvEnableProtectMD(pDevice->PortOffset);
-   else
-   MACvDisableProtectMD(pDevice->PortOffset);
+   byCWMaxMin = 0xa4;
 
-   }
-   if (pDevice->bBarkerPreambleMd != 
VNTWIFIbIsBarkerMode(byERPField)) {
-   pDevice->bBarkerPreambleMd = 
VNTWIFIbIsBarkerMode(byERPField);
-   if (pDevice->bBarkerPreambleMd)
-   MACvEnableBarkerPreambleMd(pDevice->PortOffset);
-   

[PATCH v2 07/34] staging: vt6655: mac80211 conversion: s_uFillDataHead add power saving poll

2014-10-29 Thread Malcolm Priestley
Replace variable wCurrentRate with is_pspoll.

add current_aid to structure vnt_private which is to be used by
mac80211 operations.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h |  1 +
 drivers/staging/vt6655/rxtx.c   | 64 +
 2 files changed, 47 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index bc9b81a..7d521c6 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -324,6 +324,7 @@ struct vnt_private {
struct ieee80211_hw *hw;
struct ieee80211_vif *vif;
unsigned long key_entry_inuse;
+   u16 current_aid;
 /* netdev */
struct net_device *dev;
 
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index a1a594f..23ee379 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -169,7 +169,8 @@ s_uFillDataHead(
unsigned int cbLastFragmentSize,
unsigned int uMACfragNum,
unsigned char byFBOption,
-   unsigned short wCurrentRate
+   unsigned short wCurrentRate,
+   bool is_pspoll
 );
 
 /*-  Export Variables  --*/
@@ -674,7 +675,8 @@ s_uFillDataHead(
unsigned int cbLastFragmentSize,
unsigned int uMACfragNum,
unsigned char byFBOption,
-   unsigned short wCurrentRate
+   unsigned short wCurrentRate,
+   bool is_pspoll
 )
 {
 
@@ -693,15 +695,24 @@ s_uFillDataHead(
  pDevice->byTopCCKBasicRate,
  PK_TYPE_11B, &buf->b);
 
-   /* Get Duration and TimeStamp */
-   buf->duration_a = 
cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength,
- 
byPktType, wCurrentRate, bNeedAck, uFragIdx,
- 
cbLastFragmentSize, uMACfragNum,
- 
byFBOption));
-   buf->duration_b = 
cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength,
- 
PK_TYPE_11B, pDevice->byTopCCKBasicRate,
- 
bNeedAck, uFragIdx, cbLastFragmentSize,
- 
uMACfragNum, byFBOption));
+   if (is_pspoll) {
+   __le16 dur = cpu_to_le16(pDevice->current_aid | 
BIT(14) | BIT(15));
+
+   buf->duration_a = dur;
+   buf->duration_b = dur;
+   } else {
+   /* Get Duration and TimeStamp */
+   buf->duration_a =
+   
cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength,
+   
byPktType, wCurrentRate, bNeedAck, uFragIdx,
+   
cbLastFragmentSize, uMACfragNum,
+   
byFBOption));
+   buf->duration_b =
+   
cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength,
+   
PK_TYPE_11B, pDevice->byTopCCKBasicRate,
+   
bNeedAck, uFragIdx, cbLastFragmentSize,
+   
uMACfragNum, byFBOption));
+   }
 
buf->time_stamp_off_a = vnt_time_stamp_off(pDevice, 
wCurrentRate);
buf->time_stamp_off_b = vnt_time_stamp_off(pDevice, 
pDevice->byTopCCKBasicRate);
@@ -755,11 +766,18 @@ s_uFillDataHead(
vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate,
  byPktType, &buf->ab);
 
-   /* Get Duration and TimeStampOff */
-   buf->duration = 
cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, 
byPktType,
+   if (is_pspoll) {
+   __le16 dur = cpu_to_le16(pDevice->current_aid | 
BIT(14) | BIT(15));
+
+   buf->duration = dur;
+   } else {
+   /* Get Duration and TimeStampOff */
+   buf->duration =
+   
cpu_to_le16((u16)s_uGetDataDuration(pDevice, D

[PATCH v2 11/34] staging: vt6655: mac80211 conversion: device_print_info remove netdevice.

2014-10-29 Thread Malcolm Priestley
use dev_info for device name and pcid->irq for irq number.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index b0f94a8..5ece184 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -809,12 +809,11 @@ static const struct net_device_ops device_netdev_ops = {
 
 static void device_print_info(struct vnt_private *pDevice)
 {
-   struct net_device *dev = pDevice->dev;
+   dev_info(&pDevice->pcid->dev, "%s\n", get_chip_name(pDevice->chip_id));
 
-   pr_info("%s: %s\n", dev->name, get_chip_name(pDevice->chip_id));
-   pr_info("%s: MAC=%pM IO=0x%lx Mem=0x%lx IRQ=%d\n",
-   dev->name, dev->dev_addr, (unsigned long)pDevice->ioaddr,
-   (unsigned long)pDevice->PortOffset, pDevice->dev->irq);
+   dev_info(&pDevice->pcid->dev, "MAC=%pM IO=0x%lx Mem=0x%lx IRQ=%d\n",
+pDevice->abyCurrentNetAddr, (unsigned long)pDevice->ioaddr,
+(unsigned long)pDevice->PortOffset, pDevice->pcid->irq);
 }
 
 static void vt6655_init_info(struct pci_dev *pcid,
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 22/34] staging: vt6655: phy type same as bb type

2014-10-29 Thread Malcolm Priestley
To maintain functionality

typedef enum _CARD_PHY_TYPE should have the same values as
typedef enum _VIA_PKT_TYPE

TODO both these types need merging.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/card.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
index 96f5b6c..a51a849 100644
--- a/drivers/staging/vt6655/card.h
+++ b/drivers/staging/vt6655/card.h
@@ -52,10 +52,10 @@
 #define CB_MAX_CHANNEL  (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
 
 typedef enum _CARD_PHY_TYPE {
-   PHY_TYPE_AUTO,
+   PHY_TYPE_11A = 0,
PHY_TYPE_11B,
PHY_TYPE_11G,
-   PHY_TYPE_11A
+   PHY_TYPE_AUTO
 } CARD_PHY_TYPE, *PCARD_PHY_TYPE;
 
 typedef enum _CARD_PKT_TYPE {
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 19/34] staging: vt6655: mac80211 conversion: device_init_registers remove legacy code

2014-10-29 Thread Malcolm Priestley
Remove pMgmt, byCurrentCh, VNTWIFIbConfigPhyMode, eEncryptionStatus and 
netif_stop_queue.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index a888c26..77d81b3 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -412,7 +412,6 @@ static void device_init_registers(struct vnt_private 
*pDevice)
unsigned char byCCKPwrdBm = 0;
unsigned char byOFDMPwrdBm = 0;
int zonetype = 0;
-   PSMgmtObjectpMgmt = &(pDevice->sMgmtObj);
 
MACbShutdown(pDevice->PortOffset);
BBvSoftwareReset(pDevice->PortOffset);
@@ -616,8 +615,6 @@ static void device_init_registers(struct vnt_private 
*pDevice)
   (unsigned char)(ii + 
EEP_OFS_OFDMA_PWR_dBm));
}
 
-   init_channel_table((void *)pDevice);
-
if (pDevice->byLocalID > REV_ID_VT3253_B1) {
MACvSelectPage1(pDevice->PortOffset);
 
@@ -652,8 +649,6 @@ static void device_init_registers(struct vnt_private 
*pDevice)
BBvSetRxAntennaMode(pDevice->PortOffset, pDevice->byRxAntennaMode);
BBvSetTxAntennaMode(pDevice->PortOffset, pDevice->byTxAntennaMode);
 
-   pDevice->byCurrentCh = 0;
-
/* Set BB and packet type at the same time. */
/* Set Short Slot Time, xIFS, and RSPINF. */
if (pDevice->uConnectionRate == RATE_AUTO)
@@ -661,10 +656,6 @@ static void device_init_registers(struct vnt_private 
*pDevice)
else
pDevice->wCurrentRate = (unsigned 
short)pDevice->uConnectionRate;
 
-   /* default G Mode */
-   VNTWIFIbConfigPhyMode(pDevice->pMgmt, PHY_TYPE_11G);
-   VNTWIFIbConfigPhyMode(pDevice->pMgmt, PHY_TYPE_AUTO);
-
pDevice->bRadioOff = false;
 
pDevice->byRadioCtl = SROMbyReadEmbedded(pDevice->PortOffset,
@@ -685,8 +676,6 @@ static void device_init_registers(struct vnt_private 
*pDevice)
if (pDevice->bHWRadioOff || pDevice->bRadioControlOff)
CARDbRadioPowerOff(pDevice);
 
-   pMgmt->eScanType = WMAC_SCAN_PASSIVE;
-
/* get Permanent network address */
SROMvReadEtherAddress(pDevice->PortOffset, pDevice->abyCurrentNetAddr);
pr_debug("Network address = %pM\n", pDevice->abyCurrentNetAddr);
@@ -699,16 +688,12 @@ static void device_init_registers(struct vnt_private 
*pDevice)
if (pDevice->byLocalID <= REV_ID_VT3253_A1)
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_RCR, RCR_WPAERR);
 
-   pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
-
/* Turn On Rx DMA */
MACvReceive0(pDevice->PortOffset);
MACvReceive1(pDevice->PortOffset);
 
/* start the adapter */
MACvStart(pDevice->PortOffset);
-
-   netif_stop_queue(pDevice->dev);
 }
 
 static void device_init_diversity_timer(struct vnt_private *pDevice)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 20/34] staging: vt6655: mac80211 conversion: device_free_info

2014-10-29 Thread Malcolm Priestley
Remove net device code and add mac80211 unregister code.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 25 +++--
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 77d81b3..451b608 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -806,31 +806,20 @@ static bool device_get_pci_info(struct vnt_private 
*pDevice,
 
 static void device_free_info(struct vnt_private *pDevice)
 {
-   struct net_device *dev = pDevice->dev;
-
-   ASSERT(pDevice);
-//2008-0714-01by chester
-   device_release_WPADEV(pDevice);
-
-//2008-07-21-01by MikeLiu
-//unregister wpadev
-   if (wpa_set_wpadev(pDevice, 0) != 0)
-   pr_err("unregister wpadev fail?\n");
+   if (!pDevice)
+   return;
 
-#ifdef HOSTAP
-   if (dev)
-   vt6655_hostap_set_hostapd(pDevice, 0, 0);
-#endif
-   if (dev)
-   unregister_netdev(dev);
+   if (pDevice->mac_hw)
+   ieee80211_unregister_hw(pDevice->hw);
 
if (pDevice->PortOffset)
iounmap(pDevice->PortOffset);
 
if (pDevice->pcid)
pci_release_regions(pDevice->pcid);
-   if (dev)
-   free_netdev(dev);
+
+   if (pDevice->hw)
+   ieee80211_free_hw(pDevice->hw);
 }
 
 static bool device_init_rings(struct vnt_private *pDevice)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 23/34] staging: vt6655: mac80211 conversion: device_error remove legacy functions

2014-10-29 Thread Malcolm Priestley
Remove netif_stop_queue, bCmdRunning and timer functions

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 451b608..0bd2ca8 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1313,10 +1313,6 @@ static void device_error(struct vnt_private *pDevice, 
unsigned short status)
if (status & ISR_FETALERR) {
dev_err(&pDevice->pcid->dev, "Hardware fatal error\n");
 
-   netif_stop_queue(pDevice->dev);
-   del_timer(&pDevice->sTimerCommand);
-   del_timer(&(pDevice->pMgmt->sTimerSecondCallback));
-   pDevice->bCmdRunning = false;
MACbShutdown(pDevice->PortOffset);
return;
}
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 24/34] staging: vt6655: vt6655_probe remove management pointers

2014-10-29 Thread Malcolm Priestley
All these pointers are now dead.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 0bd2ca8..d7dd002 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -3266,8 +3266,6 @@ vt6655_probe(struct pci_dev *pcid, const struct 
pci_device_id *ent)
/* Enable the chip specified capabilities */
priv->flags = priv->sOpts.flags | (pChip_info->flags & 0xff00UL);
priv->tx_80211 = device_dma0_tx_80211;
-   priv->sMgmtObj.pAdapter = (void *)priv;
-   priv->pMgmt = &(priv->sMgmtObj);
 
wiphy = priv->hw->wiphy;
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 28/34] staging: vt6655: s_vGenerateTxParameter remove unused cbMACHdLen

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/rxtx.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 23ee379..9beabea 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -1132,7 +1132,6 @@ s_vGenerateTxParameter(
unsigned short wCurrentRate
 )
 {
-   unsigned int cbMACHdLen = WLAN_HDR_ADDR3_LEN; //24
unsigned short wFifoCtl;
bool bDisCRC = false;
unsigned char byFBOption = AUTO_FB_NONE;
@@ -1150,9 +1149,6 @@ s_vGenerateTxParameter(
else if (wFifoCtl & FIFOCTL_AUTO_FB_1)
byFBOption = AUTO_FB_1;
 
-   if (pDevice->bLongHeader)
-   cbMACHdLen = WLAN_HDR_ADDR3_LEN + 6;
-
if (!pvRrvTime)
return;
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 25/34] staging: vt6655: mac80211 conversion: PSbIsNextTBTTWakeUp convert to mac80211

2014-10-29 Thread Malcolm Priestley
Wake up to listen to next beacon when struct ieee80211_conf -> listen_interval 
== 1

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/power.c | 19 ++-
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/vt6655/power.c b/drivers/staging/vt6655/power.c
index fe33bb2..5371802 100644
--- a/drivers/staging/vt6655/power.c
+++ b/drivers/staging/vt6655/power.c
@@ -327,21 +327,14 @@ PSbIsNextTBTTWakeUp(
 )
 {
struct vnt_private *pDevice = hDeviceContext;
-   PSMgmtObjectpMgmt = pDevice->pMgmt;
+   struct ieee80211_hw *hw = pDevice->hw;
+   struct ieee80211_conf *conf = &hw->conf;
bool bWakeUp = false;
 
-   if (pMgmt->wListenInterval >= 2) {
-   if (pMgmt->wCountToWakeUp == 0)
-   pMgmt->wCountToWakeUp = pMgmt->wListenInterval;
-
-   pMgmt->wCountToWakeUp--;
-
-   if (pMgmt->wCountToWakeUp == 1) {
-   // Turn on wake up to listen next beacon
-   MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, 
PSCTL_LNBCN);
-   bWakeUp = true;
-   }
-
+   if (conf->listen_interval == 1) {
+   /* Turn on wake up to listen next beacon */
+   MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_LNBCN);
+   bWakeUp = true;
}
 
return bWakeUp;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 31/34] staging: vt6655: fifo & frag control remove big endian values

2014-10-29 Thread Malcolm Priestley
Endian conversion now happens at run time only little endian
values are valid.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/desc.h | 32 
 1 file changed, 32 deletions(-)

diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
index 9068c3e..b59405b 100644
--- a/drivers/staging/vt6655/desc.h
+++ b/drivers/staging/vt6655/desc.h
@@ -118,37 +118,7 @@
  */
 #define CB_MAX_TX_ABORT_RETRY   3
 
-#ifdef __BIG_ENDIAN
-
 /* WMAC definition FIFO Control */
-#define FIFOCTL_AUTO_FB_1   0x0010
-#define FIFOCTL_AUTO_FB_0   0x0008
-#define FIFOCTL_GRPACK  0x0004
-#define FIFOCTL_11GA0x0003
-#define FIFOCTL_11GB0x0002
-#define FIFOCTL_11B 0x0001
-#define FIFOCTL_11A 0x
-#define FIFOCTL_RTS 0x8000
-#define FIFOCTL_ISDMA0  0x4000
-#define FIFOCTL_GENINT  0x2000
-#define FIFOCTL_TMOEN   0x1000
-#define FIFOCTL_LRETRY  0x0800
-#define FIFOCTL_CRCDIS  0x0400
-#define FIFOCTL_NEEDACK 0x0200
-#define FIFOCTL_LHEAD   0x0100
-
-/* WMAC definition Frag Control */
-#define FRAGCTL_AES 0x0003
-#define FRAGCTL_TKIP0x0002
-#define FRAGCTL_LEGACY  0x0001
-#define FRAGCTL_NONENCRYPT  0x
-#define FRAGCTL_ENDFRAG 0x0300
-#define FRAGCTL_MIDFRAG 0x0200
-#define FRAGCTL_STAFRAG 0x0100
-#define FRAGCTL_NONFRAG 0x
-
-#else
-
 #define FIFOCTL_AUTO_FB_1   0x1000
 #define FIFOCTL_AUTO_FB_0   0x0800
 #define FIFOCTL_GRPACK  0x0400
@@ -175,8 +145,6 @@
 #define FRAGCTL_STAFRAG 0x0001
 #define FRAGCTL_NONFRAG 0x
 
-#endif
-
 #define TYPE_TXDMA0 0
 #define TYPE_AC0DMA 1
 #define TYPE_ATIMDMA2
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 29/34] staging: vt6655: device_init_registers replace spin lock

2014-10-29 Thread Malcolm Priestley
Use spin_lock_irqsave and spin_unlock_irqrestore.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index d7dd002..c5eca10 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -406,6 +406,7 @@ device_set_options(struct vnt_private *pDevice)
 
 static void device_init_registers(struct vnt_private *pDevice)
 {
+   unsigned long flags;
unsigned int ii;
unsigned char byValue;
unsigned char byValue1;
@@ -439,11 +440,11 @@ static void device_init_registers(struct vnt_private 
*pDevice)
/* Get Local ID */
VNSvInPortB(pDevice->PortOffset + MAC_REG_LOCALID, &pDevice->byLocalID);
 
-   spin_lock_irq(&pDevice->lock);
+   spin_lock_irqsave(&pDevice->lock, flags);
 
SROMvReadAllContents(pDevice->PortOffset, pDevice->abyEEPROM);
 
-   spin_unlock_irq(&pDevice->lock);
+   spin_unlock_irqrestore(&pDevice->lock, flags);
 
/* Get Channel range */
pDevice->byMinChannel = 1;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 34/34] staging: vt6655: reset tsf on dissociation

2014-10-29 Thread Malcolm Priestley
Ensuring that tsf counter does not run while idle.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 968ea9a..07d2101 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -2980,6 +2980,11 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
 
CARDvSetFirstNextTBTT(priv->PortOffset,
  conf->beacon_int);
+   } else {
+   VNSvOutPortB(priv->PortOffset + MAC_REG_TFTCTL,
+TFTCTL_TSFCNTRST);
+   VNSvOutPortB(priv->PortOffset + MAC_REG_TFTCTL,
+TFTCTL_TSFCNTREN);
}
}
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 26/34] staging: vt6655: MACvSetDefaultKeyEntry replace WLAN_WEP104_KEYLEN

2014-10-29 Thread Malcolm Priestley
with WLAN_KEY_LEN_WEP40

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index e3b0b7f..a347f39 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -1526,7 +1526,7 @@ void MACvSetDefaultKeyEntry(void __iomem *dwIoBase, 
unsigned int uKeyLen,
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE);
}
dwData = *pdwKey;
-   if (uKeyLen == WLAN_WEP104_KEYLEN)
+   if (uKeyLen == WLAN_KEY_LEN_WEP40)
dwData |= 0x8000;
 
VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset+3);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 30/34] staging: vt6655: baseband.c timers replace spin lock

2014-10-29 Thread Malcolm Priestley
Use spin_lock_irqsave and spin_unlock_irqrestore

in functions TimerSQ3CallBack and TimerState1CallBack

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/baseband.c | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6655/baseband.c 
b/drivers/staging/vt6655/baseband.c
index 8adeea4..c7ad927 100644
--- a/drivers/staging/vt6655/baseband.c
+++ b/drivers/staging/vt6655/baseband.c
@@ -2786,9 +2786,11 @@ TimerSQ3CallBack(
 )
 {
struct vnt_private *pDevice = hDeviceContext;
+   unsigned long flags;
 
pr_debug("TimerSQ3CallBack...\n");
-   spin_lock_irq(&pDevice->lock);
+
+   spin_lock_irqsave(&pDevice->lock, flags);
 
pr_debug("3.[%08x][%08x], %d\n",
 (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1,
@@ -2803,7 +2805,7 @@ TimerSQ3CallBack(
add_timer(&pDevice->TimerSQ3Tmax3);
add_timer(&pDevice->TimerSQ3Tmax2);
 
-   spin_unlock_irq(&pDevice->lock);
+   spin_unlock_irqrestore(&pDevice->lock, flags);
 }
 
 /*+
@@ -2830,10 +2832,12 @@ TimerState1CallBack(
 )
 {
struct vnt_private *pDevice = hDeviceContext;
+   unsigned long flags;
 
pr_debug("TimerState1CallBack...\n");
 
-   spin_lock_irq(&pDevice->lock);
+   spin_lock_irqsave(&pDevice->lock, flags);
+
if (pDevice->uDiversityCnt < pDevice->ulDiversityMValue/100) {
s_vChangeAntenna(pDevice);
pDevice->TimerSQ3Tmax3.expires =  RUN_AT(pDevice->byTMax3 * HZ);
@@ -2864,5 +2868,6 @@ TimerState1CallBack(
}
pDevice->byAntennaState = 0;
BBvClearAntDivSQ3Value(pDevice);
-   spin_unlock_irq(&pDevice->lock);
+
+   spin_unlock_irqrestore(&pDevice->lock, flags);
 }
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 27/34] staging: vt6655: baseband.c replace BIT0 with BIT(0)

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/baseband.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6655/baseband.c 
b/drivers/staging/vt6655/baseband.c
index b8a64c0..8adeea4 100644
--- a/drivers/staging/vt6655/baseband.c
+++ b/drivers/staging/vt6655/baseband.c
@@ -2116,7 +2116,7 @@ bool BBbVT3253Init(struct vnt_private *pDevice)
bResult &= BBbWriteEmbedded(dwIoBase, 
byVT3253B0_AGC4_RFMD2959[ii][0], byVT3253B0_AGC4_RFMD2959[ii][1]);
 
VNSvOutPortD(dwIoBase + MAC_REG_ITRTMSET, 0x23);
-   MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0);
+   MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT(0));
}
pDevice->abyBBVGA[0] = 0x18;
pDevice->abyBBVGA[1] = 0x0A;
@@ -2149,7 +2149,7 @@ bool BBbVT3253Init(struct vnt_private *pDevice)
bResult &= BBbWriteEmbedded(dwIoBase, 
byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
 
VNSvOutPortB(dwIoBase + MAC_REG_ITRTMSET, 0x23);
-   MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0);
+   MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT(0));
 
pDevice->abyBBVGA[0] = 0x14;
pDevice->abyBBVGA[1] = 0x0A;
@@ -2455,7 +2455,7 @@ BBvPowerSaveModeON(void __iomem *dwIoBase)
unsigned char byOrgData;
 
BBbReadEmbedded(dwIoBase, 0x0D, &byOrgData);
-   byOrgData |= BIT0;
+   byOrgData |= BIT(0);
BBbWriteEmbedded(dwIoBase, 0x0D, byOrgData);
 }
 
@@ -2477,7 +2477,7 @@ BBvPowerSaveModeOFF(void __iomem *dwIoBase)
unsigned char byOrgData;
 
BBbReadEmbedded(dwIoBase, 0x0D, &byOrgData);
-   byOrgData &= ~(BIT0);
+   byOrgData &= ~(BIT(0));
BBbWriteEmbedded(dwIoBase, 0x0D, byOrgData);
 }
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 33/34] staging: vt6655: don't update bUpdateBBVGA when off channel

2014-10-29 Thread Malcolm Priestley
Check flag conf IEEE80211_CONF_OFFCHANNEL so that RSSI doesn't swing wildly
on scanning.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index c5eca10..968ea9a 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -2040,6 +2040,7 @@ static  irqreturn_t  device_intr(int irq,  void 
*dev_instance)
if (pDevice->vif &&
pDevice->op_mode != NL80211_IFTYPE_ADHOC) {
if (pDevice->bUpdateBBVGA &&
+   !(pDevice->hw->conf.flags & 
IEEE80211_CONF_OFFCHANNEL) &&
pDevice->vif->bss_conf.assoc &&
pDevice->uCurrRSSI) {
longldBm;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 21/34] staging: vt6655: switch driver over to mac80211

2014-10-29 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/Kconfig | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/Kconfig b/drivers/staging/vt6655/Kconfig
index c3ba693..77cfc70 100644
--- a/drivers/staging/vt6655/Kconfig
+++ b/drivers/staging/vt6655/Kconfig
@@ -1,8 +1,6 @@
 config VT6655
tristate "VIA Technologies VT6655 support"
-   depends on PCI && WLAN && m
-   select WIRELESS_EXT
-   select WEXT_PRIV
+   depends on PCI && MAC80211 && m
---help---
This is a vendor-written driver for VIA VT6655.
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 32/34] staging: vt6655: vnt_rx_data: uCurrRSSI should have the value of *rssi

2014-10-29 Thread Malcolm Priestley
Fixes issue of byBBVGANew is wrong in device_intr

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/dpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index 036bbb0..11153ef 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -1382,7 +1382,7 @@ static bool vnt_rx_data(struct vnt_private *priv, struct 
sk_buff *skb,
RFvRSSITodBm(priv, *rssi, &rx_dbm);
 
priv->byBBPreEDRSSI = (u8)rx_dbm + 1;
-   priv->uCurrRSSI = priv->byBBPreEDRSSI;
+   priv->uCurrRSSI = *rssi;
 
skb_pull(skb, 4);
skb_trim(skb, frame_size);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 12/34] staging: vt6655: mac80211 conversion: changes to device_intr

2014-10-29 Thread Malcolm Priestley
Remove net device code.

Remove current measure code and function s_vCompleteCurrentMeasure
and switch code which are now handled by mac80211

Change beaconing to mac80211.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 175 ++-
 1 file changed, 8 insertions(+), 167 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 5ece184..69c98c2 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -400,45 +400,6 @@ device_set_options(struct vnt_private *pDevice)
 (int)pDevice->bDiversityRegCtlON);
 }
 
-static void s_vCompleteCurrentMeasure(struct vnt_private *pDevice,
- unsigned char byResult)
-{
-   unsigned int ii;
-   unsigned long dwDuration = 0;
-   unsigned char byRPI0 = 0;
-
-   for (ii = 1; ii < 8; ii++) {
-   pDevice->dwRPIs[ii] *= 255;
-   dwDuration |= *((unsigned short 
*)(pDevice->pCurrMeasureEID->sReq.abyDuration));
-   dwDuration <<= 10;
-   pDevice->dwRPIs[ii] /= dwDuration;
-   pDevice->abyRPIs[ii] = (unsigned char)pDevice->dwRPIs[ii];
-   byRPI0 += pDevice->abyRPIs[ii];
-   }
-   pDevice->abyRPIs[0] = (0xFF - byRPI0);
-
-   if (pDevice->uNumOfMeasureEIDs == 0) {
-   VNTWIFIbMeasureReport(pDevice->pMgmt,
- true,
- pDevice->pCurrMeasureEID,
- byResult,
- pDevice->byBasicMap,
- pDevice->byCCAFraction,
- pDevice->abyRPIs
-   );
-   } else {
-   VNTWIFIbMeasureReport(pDevice->pMgmt,
- false,
- pDevice->pCurrMeasureEID,
- byResult,
- pDevice->byBasicMap,
- pDevice->byCCAFraction,
- pDevice->abyRPIs
-   );
-   CARDbStartMeasure(pDevice, pDevice->pCurrMeasureEID++, 
pDevice->uNumOfMeasureEIDs);
-   }
-}
-
 //
 // Initialisation of MAC & BBP registers
 //
@@ -2056,14 +2017,11 @@ static int  device_xmit(struct sk_buff *skb, struct 
net_device *dev) {
 
 static  irqreturn_t  device_intr(int irq,  void *dev_instance)
 {
-   struct net_device *dev = dev_instance;
-   struct vnt_private *pDevice = netdev_priv(dev);
+   struct vnt_private *pDevice = dev_instance;
int max_count = 0;
unsigned long dwMIBCounter = 0;
-   PSMgmtObjectpMgmt = pDevice->pMgmt;
unsigned char byOrgPageSel = 0;
int handled = 0;
-   unsigned char byData = 0;
int ii = 0;
unsigned long flags;
 
@@ -2106,94 +2064,7 @@ static  irqreturn_t  device_intr(int irq,  void 
*dev_instance)
device_error(pDevice, pDevice->dwIsr);
}
 
-   if (pDevice->byLocalID > REV_ID_VT3253_B1) {
-   if (pDevice->dwIsr & ISR_MEASURESTART) {
-   // 802.11h measure start
-   pDevice->byOrgChannel = pDevice->byCurrentCh;
-   VNSvInPortB(pDevice->PortOffset + MAC_REG_RCR, 
&(pDevice->byOrgRCR));
-   VNSvOutPortB(pDevice->PortOffset + MAC_REG_RCR, 
(RCR_RXALLTYPE | RCR_UNICAST | RCR_BROADCAST | RCR_MULTICAST | RCR_WPAERR));
-   MACvSelectPage1(pDevice->PortOffset);
-   VNSvInPortD(pDevice->PortOffset + MAC_REG_MAR0, 
&(pDevice->dwOrgMAR0));
-   VNSvInPortD(pDevice->PortOffset + MAC_REG_MAR4, 
&(pDevice->dwOrgMAR4));
-   MACvSelectPage0(pDevice->PortOffset);
-   //
-   if (set_channel(pDevice, 
pDevice->pCurrMeasureEID->sReq.byChannel)) {
-   pDevice->bMeasureInProgress = true;
-   MACvSelectPage1(pDevice->PortOffset);
-   MACvRegBitsOn(pDevice->PortOffset, 
MAC_REG_MSRCTL, MSRCTL_READY);
-   MACvSelectPage0(pDevice->PortOffset);
-   pDevice->byBasicMap = 0;
-   pDevice->byCCAFraction = 0;
-   for (ii = 0; ii < 8; ii++)
-   pDevice->dwRPIs[ii] = 0;
-
-   } else {
-   // can not measure because set channel 
fail
-   //

[PATCH v2 08/34] staging: vt6655: mac80211 conversion add main mac80211 functions

2014-10-29 Thread Malcolm Priestley
Replace existing vt6655_probe with one converted to mac80211
with the following operations

vnt_tx_80211
vnt_start
vnt_stop
vnt_add_interface
vnt_remove_interface
vnt_config
vnt_bss_info_changed
vnt_prepare_multicast
vnt_configure
vnt_set_key
vnt_get_tsf
vnt_set_tsf
vnt_reset_tsf

The following variables are also added.
basic_rates
mc_list_count
mac_hw

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device.h  |   3 +
 drivers/staging/vt6655/device_main.c | 754 ---
 2 files changed, 621 insertions(+), 136 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 7d521c6..17a36dc 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -324,7 +324,10 @@ struct vnt_private {
struct ieee80211_hw *hw;
struct ieee80211_vif *vif;
unsigned long key_entry_inuse;
+   u32 basic_rates;
u16 current_aid;
+   int mc_list_count;
+   u8 mac_hw;
 /* netdev */
struct net_device *dev;
 
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index c8ee91c..23d9344 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -809,142 +809,6 @@ static const struct net_device_ops device_netdev_ops = {
.ndo_set_rx_mode= device_set_multi,
 };
 
-static int
-vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
-{
-   static bool bFirst = true;
-   struct net_device *dev = NULL;
-   PCHIP_INFO  pChip_info = (PCHIP_INFO)ent->driver_data;
-   struct vnt_private *pDevice;
-   int rc;
-
-   dev = alloc_etherdev(sizeof(*pDevice));
-
-   pDevice = netdev_priv(dev);
-
-   if (dev == NULL) {
-   pr_err(DEVICE_NAME ": allocate net device failed\n");
-   return -ENOMEM;
-   }
-
-   // Chain it all together
-   SET_NETDEV_DEV(dev, &pcid->dev);
-
-   if (bFirst) {
-   pr_notice("%s Ver. %s\n", DEVICE_FULL_DRV_NAM, DEVICE_VERSION);
-   pr_notice("Copyright (c) 2003 VIA Networking Technologies, 
Inc.\n");
-   bFirst = false;
-   }
-
-   vt6655_init_info(pcid, &pDevice, pChip_info);
-   pDevice->dev = dev;
-
-   if (pci_enable_device(pcid)) {
-   device_free_info(pDevice);
-   return -ENODEV;
-   }
-   dev->irq = pcid->irq;
-
-#ifdef DEBUG
-   pr_debug("Before get pci_info memaddr is %x\n", pDevice->memaddr);
-#endif
-   if (!device_get_pci_info(pDevice, pcid)) {
-   pr_err(DEVICE_NAME ": Failed to find PCI device.\n");
-   device_free_info(pDevice);
-   return -ENODEV;
-   }
-
-#ifdef DEBUG
-
-   pr_debug("after get pci_info memaddr is %x, io addr is %x,io_size is 
%d\n", pDevice->memaddr, pDevice->ioaddr, pDevice->io_size);
-   {
-   int i;
-   u32 bar, len;
-   u32 address[] = {
-   PCI_BASE_ADDRESS_0,
-   PCI_BASE_ADDRESS_1,
-   PCI_BASE_ADDRESS_2,
-   PCI_BASE_ADDRESS_3,
-   PCI_BASE_ADDRESS_4,
-   PCI_BASE_ADDRESS_5,
-   0};
-   for (i = 0; address[i]; i++) {
-   pci_read_config_dword(pcid, address[i], &bar);
-   pr_debug("bar %d is %x\n", i, bar);
-   if (!bar) {
-   pr_debug("bar %d not implemented\n", i);
-   continue;
-   }
-   if (bar & PCI_BASE_ADDRESS_SPACE_IO) {
-   /* This is IO */
-
-   len = bar & (PCI_BASE_ADDRESS_IO_MASK & 0x);
-   len = len & ~(len - 1);
-
-   pr_debug("IO space:  len in IO %x, BAR %d\n", 
len, i);
-   } else {
-   len = bar & 0xFFF0;
-   len = ~len + 1;
-
-   pr_debug("len in MEM %x, BAR %d\n", len, i);
-   }
-   }
-   }
-#endif
-
-   pDevice->PortOffset = ioremap(pDevice->memaddr & 
PCI_BASE_ADDRESS_MEM_MASK, pDevice->io_size);
-
-   if (pDevice->PortOffset == NULL) {
-   pr_err(DEVICE_NAME ": Failed to IO remapping ..\n");
-   device_free_info(pDevice);
-   return -ENODEV;
-   }
-
-   rc = pci_request_regions(pcid, DEVICE_NAME);
-   if (rc) {
-   pr_err(DEVICE_NAME ": Failed to find PCI device\n");
-   device_free_info(pDevice);
-   return -ENODEV;
-   }
-
-   dev->base_addr = pDevice->ioaddr;
-   // do reset
-   if (!MACbSoftwareReset(pDevice->PortOffset)) {
-   pr_err(DEVICE_NAME ": Failed to access MAC hardware.

[PATCH v2 13/34] staging: vt6655: mac80211 conversion: device_tx_srv tx and add report rates

2014-10-29 Thread Malcolm Priestley
vnt_int_report_rate reports backs tx rate and is replacment for 
STAvUpdateTDStatCounter
and BSSvUpdateNodeTxCounter.

Replacing existing code.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 166 ++-
 1 file changed, 85 insertions(+), 81 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 69c98c2..a888c26 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1208,19 +1208,84 @@ bool device_alloc_frag_buf(struct vnt_private *pDevice,
return true;
 }
 
+static const u8 fallback_rate0[5][5] = {
+   {RATE_18M, RATE_18M, RATE_12M, RATE_12M, RATE_12M},
+   {RATE_24M, RATE_24M, RATE_18M, RATE_12M, RATE_12M},
+   {RATE_36M, RATE_36M, RATE_24M, RATE_18M, RATE_18M},
+   {RATE_48M, RATE_48M, RATE_36M, RATE_24M, RATE_24M},
+   {RATE_54M, RATE_54M, RATE_48M, RATE_36M, RATE_36M}
+};
+
+static const u8 fallback_rate1[5][5] = {
+   {RATE_18M, RATE_18M, RATE_12M, RATE_6M, RATE_6M},
+   {RATE_24M, RATE_24M, RATE_18M, RATE_6M, RATE_6M},
+   {RATE_36M, RATE_36M, RATE_24M, RATE_12M, RATE_12M},
+   {RATE_48M, RATE_48M, RATE_24M, RATE_12M, RATE_12M},
+   {RATE_54M, RATE_54M, RATE_36M, RATE_18M, RATE_18M}
+};
+
+static int vnt_int_report_rate(struct vnt_private *priv,
+  PDEVICE_TD_INFO context, u8 tsr0, u8 tsr1)
+{
+   struct vnt_tx_fifo_head *fifo_head;
+   struct ieee80211_tx_info *info;
+   struct ieee80211_rate *rate;
+   u16 fb_option;
+   u8 tx_retry = (tsr0 & TSR0_NCR);
+   s8 idx;
+
+   if (!context)
+   return -ENOMEM;
+
+   if (!context->skb)
+   return -EINVAL;
+
+   fifo_head = (struct vnt_tx_fifo_head *)context->buf;
+   fb_option = (le16_to_cpu(fifo_head->fifo_ctl) &
+   (FIFOCTL_AUTO_FB_0 | FIFOCTL_AUTO_FB_1));
+
+   info = IEEE80211_SKB_CB(context->skb);
+   idx = info->control.rates[0].idx;
+
+   if (fb_option && !(tsr1 & TSR1_TERR)) {
+   u8 tx_rate;
+   u8 retry = tx_retry;
+
+   rate = ieee80211_get_tx_rate(priv->hw, info);
+   tx_rate = rate->hw_value - RATE_18M;
+
+   if (retry > 4)
+   retry = 4;
+
+   if (fb_option & FIFOCTL_AUTO_FB_0)
+   tx_rate = fallback_rate0[tx_rate][retry];
+   else if (fb_option & FIFOCTL_AUTO_FB_1)
+   tx_rate = fallback_rate1[tx_rate][retry];
+
+   if (info->band == IEEE80211_BAND_5GHZ)
+   idx = tx_rate - RATE_6M;
+   else
+   idx = tx_rate;
+   }
+
+   ieee80211_tx_info_clear_status(info);
+
+   info->status.rates[0].count = tx_retry;
+
+   if (!(tsr1 & TSR1_TERR)) {
+   info->status.rates[0].idx = idx;
+   info->flags |= IEEE80211_TX_STAT_ACK;
+   }
+
+   return 0;
+}
+
 static int device_tx_srv(struct vnt_private *pDevice, unsigned int uIdx)
 {
PSTxDesc pTD;
-   bool bFull = false;
int  works = 0;
unsigned char byTsr0;
unsigned char byTsr1;
-   unsigned intuFrameSize, uFIFOHeaderSize;
-   PSTxBufHead  pTxBufHead;
-   struct net_device_stats *pStats = &pDevice->dev->stats;
-   struct sk_buff *skb;
-   unsigned intuNodeIndex;
-   PSMgmtObject pMgmt = pDevice->pMgmt;
 
for (pTD = pDevice->apTailTD[uIdx]; pDevice->iTDUsed[uIdx] > 0; pTD = 
pTD->next) {
if (pTD->m_td0TD0.f1Owner == OWNED_BY_NIC)
@@ -1234,22 +1299,8 @@ static int device_tx_srv(struct vnt_private *pDevice, 
unsigned int uIdx)
//Only the status of first TD in the chain is correct
if (pTD->m_td1TD1.byTCR & TCR_STP) {
if ((pTD->pTDInfo->byFlags & TD_FLAGS_NETIF_SKB) != 0) {
-   uFIFOHeaderSize = pTD->pTDInfo->dwHeaderLength;
-   uFrameSize = pTD->pTDInfo->dwReqCount - 
uFIFOHeaderSize;
-   pTxBufHead = (PSTxBufHead) (pTD->pTDInfo->buf);
-   // Update the statistics based on the Transmit 
status
-   // now, we DONT check TSR0_CDH
-
-   STAvUpdateTDStatCounter(&pDevice->scStatistic,
-   byTsr0, byTsr1,
-   (unsigned char 
*)(pTD->pTDInfo->buf + uFIFOHeaderSize),
-   uFrameSize, uIdx);
-
-   BSSvUpdateNodeTxCounter(pDevice,
-   byTsr0, byTsr1,
-   (unsigned char 
*)(pTD->pTDInfo->buf),
-  

[PATCH v2 10/34] staging: vt6655: mac80211 conversion replace suspend resume functions

2014-10-29 Thread Malcolm Priestley
add vt6655_suspend and vt6655_resume

remove viawget_suspend and viawget_resume.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/device_main.c | 104 ---
 1 file changed, 34 insertions(+), 70 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 054841b..b0f94a8 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -274,8 +274,6 @@ static int  device_ioctl(struct net_device *dev, struct 
ifreq *rq, int cmd);
 
 #ifdef CONFIG_PM
 static int device_notify_reboot(struct notifier_block *, unsigned long event, 
void *ptr);
-static int viawget_suspend(struct pci_dev *pcid, pm_message_t state);
-static int viawget_resume(struct pci_dev *pcid);
 static struct notifier_block device_notifier = {
.notifier_call = device_notify_reboot,
.next = NULL,
@@ -3482,6 +3480,37 @@ vt6655_probe(struct pci_dev *pcid, const struct 
pci_device_id *ent)
 
 /*--*/
 
+#ifdef CONFIG_PM
+static int vt6655_suspend(struct pci_dev *pcid, pm_message_t state)
+{
+   struct vnt_private *priv = pci_get_drvdata(pcid);
+   unsigned long flags;
+
+   spin_lock_irqsave(&priv->lock, flags);
+
+   pci_save_state(pcid);
+
+   MACbShutdown(priv->PortOffset);
+
+   pci_disable_device(pcid);
+   pci_set_power_state(pcid, pci_choose_state(pcid, state));
+
+   spin_unlock_irqrestore(&priv->lock, flags);
+
+   return 0;
+}
+
+static int vt6655_resume(struct pci_dev *pcid)
+{
+
+   pci_set_power_state(pcid, PCI_D0);
+   pci_enable_wake(pcid, PCI_D0, 0);
+   pci_restore_state(pcid);
+
+   return 0;
+}
+#endif
+
 MODULE_DEVICE_TABLE(pci, vt6655_pci_id_table);
 
 static struct pci_driver device_driver = {
@@ -3490,8 +3519,8 @@ static struct pci_driver device_driver = {
.probe = vt6655_probe,
.remove = vt6655_remove,
 #ifdef CONFIG_PM
-   .suspend = viawget_suspend,
-   .resume = viawget_resume,
+   .suspend = vt6655_suspend,
+   .resume = vt6655_resume,
 #endif
 };
 
@@ -3532,75 +3561,10 @@ device_notify_reboot(struct notifier_block *nb, 
unsigned long event, void *p)
for_each_pci_dev(pdev) {
if (pci_dev_driver(pdev) == &device_driver) {
if (pci_get_drvdata(pdev))
-   viawget_suspend(pdev, PMSG_HIBERNATE);
+   vt6655_suspend(pdev, PMSG_HIBERNATE);
}
}
}
return NOTIFY_DONE;
 }
-
-static int
-viawget_suspend(struct pci_dev *pcid, pm_message_t state)
-{
-   int power_status;   // to silence the compiler
-
-   struct vnt_private *pDevice = pci_get_drvdata(pcid);
-   PSMgmtObject  pMgmt = pDevice->pMgmt;
-
-   netif_stop_queue(pDevice->dev);
-   spin_lock_irq(&pDevice->lock);
-   pci_save_state(pcid);
-   del_timer(&pDevice->sTimerCommand);
-   del_timer(&pMgmt->sTimerSecondCallback);
-   pDevice->cbFreeCmdQueue = CMD_Q_SIZE;
-   pDevice->uCmdDequeueIdx = 0;
-   pDevice->uCmdEnqueueIdx = 0;
-   pDevice->bCmdRunning = false;
-   MACbShutdown(pDevice->PortOffset);
-   MACvSaveContext(pDevice->PortOffset, pDevice->abyMacContext);
-   pDevice->bLinkPass = false;
-   memset(pMgmt->abyCurrBSSID, 0, 6);
-   pMgmt->eCurrState = WMAC_STATE_IDLE;
-   pci_disable_device(pcid);
-   power_status = pci_set_power_state(pcid, pci_choose_state(pcid, state));
-   spin_unlock_irq(&pDevice->lock);
-   return 0;
-}
-
-static int
-viawget_resume(struct pci_dev *pcid)
-{
-   struct vnt_private *pDevice = pci_get_drvdata(pcid);
-   PSMgmtObject  pMgmt = pDevice->pMgmt;
-   int power_status;   // to silence the compiler
-
-   power_status = pci_set_power_state(pcid, PCI_D0);
-   power_status = pci_enable_wake(pcid, PCI_D0, 0);
-   pci_restore_state(pcid);
-   if (netif_running(pDevice->dev)) {
-   spin_lock_irq(&pDevice->lock);
-   MACvRestoreContext(pDevice->PortOffset, pDevice->abyMacContext);
-   device_init_registers(pDevice);
-   if (pMgmt->sNodeDBTable[0].bActive) { // Assoc with BSS
-   pMgmt->sNodeDBTable[0].bActive = false;
-   pDevice->bLinkPass = false;
-   if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
-   // In Adhoc, BSS state set back to started.
-   pMgmt->eCurrState = WMAC_STATE_STARTED;
-   } else {
-   pMgmt->eCurrMode = WMAC_MODE_STANDBY;
-   pMgmt->eCurrState = WMAC_STATE_IDLE;
-   }
-   }
-   init_timer(&pMgmt->sTimerSecondCallback);
-   init_timer(&pDevice->sTimerComma

[PATCH v2 03/34] staging: vt6655: mac8021 conversion: add new tx functions

2014-10-29 Thread Malcolm Priestley
vnt_fill_txkey a mac80211 repacement for s_vFillTxKey

vnt_generate_fifo_header mac80211 replacement for vGenerateFIFOHeader

vnt_beacon_make for making and despatching beacon.

vnt_beacon_enable to enabling beacon

struct vnt_tx_fifo_head is also added to replace typedef
struct tagSTxBufHead that will be removed later.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/desc.h |   1 +
 drivers/staging/vt6655/rxtx.c | 311 ++
 drivers/staging/vt6655/rxtx.h |  14 ++
 3 files changed, 326 insertions(+)

diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
index 8f510c6..9068c3e 100644
--- a/drivers/staging/vt6655/desc.h
+++ b/drivers/staging/vt6655/desc.h
@@ -287,6 +287,7 @@ typedef struct tagTDES1 {
 STDES1;
 
 typedef struct tagDEVICE_TD_INFO {
+   void *mic_hdr;
struct sk_buff *skb;
unsigned char *buf;
dma_addr_t  skb_dma;
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index da7c0a8..99ce5a3 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -2994,3 +2994,314 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct 
sk_buff *skb,
// Poll Transmit the adapter
MACvTransmit0(pDevice->PortOffset);
 }
+
+static void vnt_fill_txkey(struct ieee80211_hdr *hdr, u8 *key_buffer,
+  struct ieee80211_key_conf *tx_key,
+  struct sk_buff *skb, u16 payload_len,
+  struct vnt_mic_hdr *mic_hdr)
+{
+   struct ieee80211_key_seq seq;
+   u8 *iv = ((u8 *)hdr + ieee80211_get_hdrlen_from_skb(skb));
+
+   /* strip header and icv len from payload */
+   payload_len -= ieee80211_get_hdrlen_from_skb(skb);
+   payload_len -= tx_key->icv_len;
+
+   switch (tx_key->cipher) {
+   case WLAN_CIPHER_SUITE_WEP40:
+   case WLAN_CIPHER_SUITE_WEP104:
+   memcpy(key_buffer, iv, 3);
+   memcpy(key_buffer + 3, tx_key->key, tx_key->keylen);
+
+   if (tx_key->keylen == WLAN_KEY_LEN_WEP40) {
+   memcpy(key_buffer + 8, iv, 3);
+   memcpy(key_buffer + 11,
+  tx_key->key, WLAN_KEY_LEN_WEP40);
+   }
+
+   break;
+   case WLAN_CIPHER_SUITE_TKIP:
+   ieee80211_get_tkip_p2k(tx_key, skb, key_buffer);
+
+   break;
+   case WLAN_CIPHER_SUITE_CCMP:
+
+   if (!mic_hdr)
+   return;
+
+   mic_hdr->id = 0x59;
+   mic_hdr->payload_len = cpu_to_be16(payload_len);
+   ether_addr_copy(mic_hdr->mic_addr2, hdr->addr2);
+
+   ieee80211_get_key_tx_seq(tx_key, &seq);
+
+   memcpy(mic_hdr->ccmp_pn, seq.ccmp.pn, IEEE80211_CCMP_PN_LEN);
+
+   if (ieee80211_has_a4(hdr->frame_control))
+   mic_hdr->hlen = cpu_to_be16(28);
+   else
+   mic_hdr->hlen = cpu_to_be16(22);
+
+   ether_addr_copy(mic_hdr->addr1, hdr->addr1);
+   ether_addr_copy(mic_hdr->addr2, hdr->addr2);
+   ether_addr_copy(mic_hdr->addr3, hdr->addr3);
+
+   mic_hdr->frame_control = cpu_to_le16(
+   le16_to_cpu(hdr->frame_control) & 0xc78f);
+   mic_hdr->seq_ctrl = cpu_to_le16(
+   le16_to_cpu(hdr->seq_ctrl) & 0xf);
+
+   if (ieee80211_has_a4(hdr->frame_control))
+   ether_addr_copy(mic_hdr->addr4, hdr->addr4);
+
+   memcpy(key_buffer, tx_key->key, WLAN_KEY_LEN_CCMP);
+
+   break;
+   default:
+   break;
+   }
+}
+
+int vnt_generate_fifo_header(struct vnt_private *priv, u32 dma_idx,
+PSTxDesc head_td, struct sk_buff *skb)
+{
+   PDEVICE_TD_INFO td_info = head_td->pTDInfo;
+   struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+   struct ieee80211_tx_rate *tx_rate = &info->control.rates[0];
+   struct ieee80211_rate *rate;
+   struct ieee80211_key_conf *tx_key;
+   struct ieee80211_hdr *hdr;
+   struct vnt_tx_fifo_head *tx_buffer_head =
+   (struct vnt_tx_fifo_head *)td_info->buf;
+   u32 frag;
+   u16 tx_body_size = skb->len, current_rate;
+   u8 pkt_type;
+   bool is_pspoll = false;
+
+   memset(tx_buffer_head, 0, sizeof(*tx_buffer_head));
+
+   hdr = (struct ieee80211_hdr *)(skb->data);
+
+   rate = ieee80211_get_tx_rate(priv->hw, info);
+
+   current_rate = rate->hw_value;
+   if (priv->wCurrentRate != current_rate &&
+   !(priv->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)) {
+   priv->wCurrentRate = current_rate;
+
+   RFbSetPower(priv, priv->wCurrentRate,
+   priv->hw->conf.chandef.chan->hw_value);
+   }
+
+   if (current_rate > RATE_11M)
+ 

[PATCH v2 04/34] staging: vt6655: mac80211 conversion: s_cbFillTxBufHead

2014-10-29 Thread Malcolm Priestley
Covert to handle mac80211 sk_buff data removing fragmentation processing
via s_vFillFragParameter and calls to vGenerateMACHeader and s_vSWencryption

fragmentation is now handled by mac80211.

There is still more todos with this function when legacy net device code
have been remove from driver.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/rxtx.c | 583 --
 1 file changed, 46 insertions(+), 537 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 99ce5a3..b114a60 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -144,7 +144,7 @@ s_vGenerateTxParameter(
unsigned intcbFrameSize,
bool bNeedACK,
unsigned intuDMAIdx,
-   PSEthernetHeader psEthHeader,
+   void *psEthHeader,
unsigned short wCurrentRate
 );
 
@@ -1176,7 +1176,7 @@ s_vGenerateTxParameter(
unsigned int cbFrameSize,
bool bNeedACK,
unsigned int uDMAIdx,
-   PSEthernetHeader psEthHeader,
+   void *psEthHeader,
unsigned short wCurrentRate
 )
 {
@@ -1301,46 +1301,26 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned 
char byPktType,
  unsigned int uDMAIdx, PSTxDesc pHeadTD,
  PSEthernetHeader psEthHeader, unsigned char *pPacket,
  bool bNeedEncrypt, PSKeyItem pTransmitKey,
- unsigned int uNodeIndex, unsigned int *puMACfragNum)
+ unsigned int is_pspoll, unsigned int *puMACfragNum)
 {
-   unsigned int cbMACHdLen;
+   PDEVICE_TD_INFO td_info = pHeadTD->pTDInfo;
+   struct sk_buff *skb = td_info->skb;
+   struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+   struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+   struct vnt_tx_fifo_head *tx_buffer_head =
+   (struct vnt_tx_fifo_head *)td_info->buf;
+   u16 fifo_ctl = le16_to_cpu(tx_buffer_head->fifo_ctl);
unsigned int cbFrameSize;
-   unsigned int cbFragmentSize; //Hdr+(IV)+payoad+(MIC)+(ICV)+FCS
-   unsigned int cbFragPayloadSize;
-   unsigned int cbLastFragmentSize; //Hdr+(IV)+payoad+(MIC)+(ICV)+FCS
-   unsigned int cbLastFragPayloadSize;
-   unsigned int uFragIdx;
-   unsigned char *pbyPayloadHead;
-   unsigned char *pbyIVHead;
-   unsigned char *pbyMacHdr;
-   unsigned short wFragType; //00:Non-Frag, 01:Start, 10:Mid, 11:Last
__le16 uDuration;
unsigned char *pbyBuffer;
-   unsigned int cbIVlen = 0;
-   unsigned int cbICVlen = 0;
-   unsigned int cbMIClen = 0;
-   unsigned int cbFCSlen = 4;
-   unsigned int cb802_1_H_len = 0;
unsigned int uLength = 0;
-   unsigned int uTmpLen = 0;
unsigned int cbMICHDR = 0;
-   u32 dwMICKey0, dwMICKey1;
-   u32 dwMIC_Priority;
-   u32 *pdwMIC_L;
-   u32 *pdwMIC_R;
-   u32 dwSafeMIC_L, dwSafeMIC_R; /* Fix "Last Frag Size" < "MIC length". */
-   bool bMIC2Frag = false;
-   unsigned int uMICFragLen = 0;
unsigned int uMACfragNum = 1;
unsigned int uPadding = 0;
unsigned int cbReqCount = 0;
-
-   bool bNeedACK;
-   bool bRTS;
-   bool bIsAdhoc;
-   unsigned char *pbyType;
+   bool bNeedACK = (bool)(fifo_ctl & FIFOCTL_NEEDACK);
+   bool bRTS = (bool)(fifo_ctl & FIFOCTL_RTS);
PSTxDesc   ptdCurr;
-   PSTxBufHeadpsTxBufHd = (PSTxBufHead) pbyTxBufferAddr;
unsigned int cbHeaderLength = 0;
void *pvRrvTime;
struct vnt_mic_hdr *pMICHDR;
@@ -1348,72 +1328,35 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned 
char byPktType,
void *pvCTS;
void *pvTxDataHd;
unsigned short wTxBufSize;   // FFinfo size
-   unsigned int uTotalCopyLength = 0;
unsigned char byFBOption = AUTO_FB_NONE;
-   bool bIsWEP256 = false;
-   PSMgmtObjectpMgmt = pDevice->pMgmt;
 
pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd = NULL;
 
-   if ((pDevice->op_mode == NL80211_IFTYPE_ADHOC) ||
-   (pDevice->op_mode == NL80211_IFTYPE_AP)) {
-   if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])))
-   bNeedACK = false;
-   else
-   bNeedACK = true;
-   bIsAdhoc = true;
-   } else {
-   // MSDUs in Infra mode always need ACK
-   bNeedACK = true;
-   bIsAdhoc = false;
-   }
-
-   if (pDevice->bLongHeader)
-   cbMACHdLen = WLAN_HDR_ADDR3_LEN + 6;
-   else
-   cbMACHdLen = WLAN_HDR_ADDR3_LEN;
+   cbFrameSize = skb->len + 4;
 
-   if ((bNeedEncrypt == true) && (pTransmitKey != NULL)) {
-   if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) {
-   cbIVlen = 4;
-   cbICVlen = 4;
-   if (pTransmitKey->uKeyLength == WLAN_WEP232_KEYLEN)
- 

[PATCH v2 05/34] staging: vt6655: dead code remove s_vFillFragParameter.

2014-10-29 Thread Malcolm Priestley
s_vFillFragParameter is nolonger used.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/rxtx.c | 47 ---
 1 file changed, 47 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index b114a60..09df536 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -148,15 +148,6 @@ s_vGenerateTxParameter(
unsigned short wCurrentRate
 );
 
-static void s_vFillFragParameter(
-   struct vnt_private *pDevice,
-   unsigned char *pbyBuffer,
-   unsigned intuTxType,
-   void *pvtdCurr,
-   unsigned short wFragType,
-   unsigned intcbReqCount
-);
-
 static unsigned int
 s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
  unsigned char *pbyTxBufferAddr, unsigned int cbFrameBodySize,
@@ -1257,44 +1248,6 @@ s_vGenerateTxParameter(
}
 }
 
-static
-void
-s_vFillFragParameter(
-   struct vnt_private *pDevice,
-   unsigned char *pbyBuffer,
-   unsigned int uTxType,
-   void *pvtdCurr,
-   unsigned short wFragType,
-   unsigned int cbReqCount
-)
-{
-   PSTxBufHead pTxBufHead = (PSTxBufHead) pbyBuffer;
-
-   if (uTxType == TYPE_SYNCDMA) {
-   PSTxSyncDesc ptdCurr = (PSTxSyncDesc)pvtdCurr;
-
-   //Set FIFOCtl & TimeStamp in TxSyncDesc
-   ptdCurr->m_wFIFOCtl = pTxBufHead->wFIFOCtl;
-   ptdCurr->m_wTimeStamp = pTxBufHead->wTimeStamp;
-   //Set TSR1 & ReqCount in TxDescHead
-   ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((unsigned 
short)(cbReqCount));
-   if (wFragType == FRAGCTL_ENDFRAG) //Last Fragmentation
-   ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP | EDMSDU);
-   else
-   ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP);
-   } else {
-   PSTxDesc ptdCurr = (PSTxDesc)pvtdCurr;
-   //Set TSR1 & ReqCount in TxDescHead
-   ptdCurr->m_td1TD1.wReqCount = cpu_to_le16((unsigned 
short)(cbReqCount));
-   if (wFragType == FRAGCTL_ENDFRAG) //Last Fragmentation
-   ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP | EDMSDU);
-   else
-   ptdCurr->m_td1TD1.byTCR |= (TCR_STP | TCR_EDP);
-   }
-
-   pTxBufHead->wFragCtl |= (unsigned short)wFragType;//0x0001; //  
 0001
-}
-
 static unsigned int
 s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
  unsigned char *pbyTxBufferAddr, unsigned int cbFrameBodySize,
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 09/34] staging: vt6655: mac80211 conversion add channel bands

2014-10-29 Thread Malcolm Priestley
Add rates and channels according to rf type for vnt_init_bands which is a
mac80211 replacement for init_channel_table.

Signed-off-by: Malcolm Priestley 
---
 drivers/staging/vt6655/channel.c | 140 +++
 drivers/staging/vt6655/channel.h |   2 +
 drivers/staging/vt6655/device_main.c |   2 +
 3 files changed, 144 insertions(+)

diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c
index a19965f..4b3c798 100644
--- a/drivers/staging/vt6655/channel.c
+++ b/drivers/staging/vt6655/channel.c
@@ -352,6 +352,146 @@ static struct
 
 /*-  Export Functions  --*/
 
+static struct ieee80211_rate vnt_rates_bg[] = {
+   { .bitrate = 10,  .hw_value = RATE_1M },
+   { .bitrate = 20,  .hw_value = RATE_2M },
+   { .bitrate = 55,  .hw_value = RATE_5M },
+   { .bitrate = 110, .hw_value = RATE_11M },
+   { .bitrate = 60,  .hw_value = RATE_6M },
+   { .bitrate = 90,  .hw_value = RATE_9M },
+   { .bitrate = 120, .hw_value = RATE_12M },
+   { .bitrate = 180, .hw_value = RATE_18M },
+   { .bitrate = 240, .hw_value = RATE_24M },
+   { .bitrate = 360, .hw_value = RATE_36M },
+   { .bitrate = 480, .hw_value = RATE_48M },
+   { .bitrate = 540, .hw_value = RATE_54M },
+};
+
+static struct ieee80211_rate vnt_rates_a[] = {
+   { .bitrate = 60,  .hw_value = RATE_6M },
+   { .bitrate = 90,  .hw_value = RATE_9M },
+   { .bitrate = 120, .hw_value = RATE_12M },
+   { .bitrate = 180, .hw_value = RATE_18M },
+   { .bitrate = 240, .hw_value = RATE_24M },
+   { .bitrate = 360, .hw_value = RATE_36M },
+   { .bitrate = 480, .hw_value = RATE_48M },
+   { .bitrate = 540, .hw_value = RATE_54M },
+};
+
+static struct ieee80211_channel vnt_channels_2ghz[] = {
+   { .center_freq = 2412, .hw_value = 1 },
+   { .center_freq = 2417, .hw_value = 2 },
+   { .center_freq = 2422, .hw_value = 3 },
+   { .center_freq = 2427, .hw_value = 4 },
+   { .center_freq = 2432, .hw_value = 5 },
+   { .center_freq = 2437, .hw_value = 6 },
+   { .center_freq = 2442, .hw_value = 7 },
+   { .center_freq = 2447, .hw_value = 8 },
+   { .center_freq = 2452, .hw_value = 9 },
+   { .center_freq = 2457, .hw_value = 10 },
+   { .center_freq = 2462, .hw_value = 11 },
+   { .center_freq = 2467, .hw_value = 12 },
+   { .center_freq = 2472, .hw_value = 13 },
+   { .center_freq = 2484, .hw_value = 14 }
+};
+
+static struct ieee80211_channel vnt_channels_5ghz[] = {
+   { .center_freq = 4915, .hw_value = 15 },
+   { .center_freq = 4920, .hw_value = 16 },
+   { .center_freq = 4925, .hw_value = 17 },
+   { .center_freq = 4935, .hw_value = 18 },
+   { .center_freq = 4940, .hw_value = 19 },
+   { .center_freq = 4945, .hw_value = 20 },
+   { .center_freq = 4960, .hw_value = 21 },
+   { .center_freq = 4980, .hw_value = 22 },
+   { .center_freq = 5035, .hw_value = 23 },
+   { .center_freq = 5040, .hw_value = 24 },
+   { .center_freq = 5045, .hw_value = 25 },
+   { .center_freq = 5055, .hw_value = 26 },
+   { .center_freq = 5060, .hw_value = 27 },
+   { .center_freq = 5080, .hw_value = 28 },
+   { .center_freq = 5170, .hw_value = 29 },
+   { .center_freq = 5180, .hw_value = 30 },
+   { .center_freq = 5190, .hw_value = 31 },
+   { .center_freq = 5200, .hw_value = 32 },
+   { .center_freq = 5210, .hw_value = 33 },
+   { .center_freq = 5220, .hw_value = 34 },
+   { .center_freq = 5230, .hw_value = 35 },
+   { .center_freq = 5240, .hw_value = 36 },
+   { .center_freq = 5260, .hw_value = 37 },
+   { .center_freq = 5280, .hw_value = 38 },
+   { .center_freq = 5300, .hw_value = 39 },
+   { .center_freq = 5320, .hw_value = 40 },
+   { .center_freq = 5500, .hw_value = 41 },
+   { .center_freq = 5520, .hw_value = 42 },
+   { .center_freq = 5540, .hw_value = 43 },
+   { .center_freq = 5560, .hw_value = 44 },
+   { .center_freq = 5580, .hw_value = 45 },
+   { .center_freq = 5600, .hw_value = 46 },
+   { .center_freq = 5620, .hw_value = 47 },
+   { .center_freq = 5640, .hw_value = 48 },
+   { .center_freq = 5660, .hw_value = 49 },
+   { .center_freq = 5680, .hw_value = 50 },
+   { .center_freq = 5700, .hw_value = 51 },
+   { .center_freq = 5745, .hw_value = 52 },
+   { .center_freq = 5765, .hw_value = 53 },
+   { .center_freq = 5785, .hw_value = 54 },
+   { .center_freq = 5805, .hw_value = 55 },
+   { .center_freq = 5825, .hw_value = 56 }
+};
+
+static struct ieee80211_supported_band vnt_supported_2ghz_band = {
+   .channels = vnt_channels_2ghz,
+   .n_channels = ARRAY_SIZE(vnt_channels_2ghz),
+   .bitrates = vnt_rates_bg,
+   .n_bitrates = ARRAY_SIZE(vnt_rates_bg),
+};
+
+static struct ieee80211_supported_band vnt_supported_5ghz_band = {
+   .channels = vnt_channels_5ghz,
+   .n_cha

  1   2   >