mac80211: update to wireless-testing 2010-05-12 plus some pending patches
SVN-Revision: 21454v19.07.3_mercusys_ac12_duma
parent
cfec944f42
commit
48e4708a34
@ -1,130 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.c
|
||||
@@ -78,6 +78,90 @@ static const struct file_operations fops
|
||||
|
||||
#define DMA_BUF_LEN 1024
|
||||
|
||||
+static ssize_t read_file_tx_chainmask(struct file *file, char __user *user_buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct ath_softc *sc = file->private_data;
|
||||
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
+ char buf[32];
|
||||
+ unsigned int len;
|
||||
+
|
||||
+ len = snprintf(buf, sizeof(buf), "0x%08x\n", common->tx_chainmask);
|
||||
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
|
||||
+}
|
||||
+
|
||||
+static ssize_t write_file_tx_chainmask(struct file *file, const char __user *user_buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct ath_softc *sc = file->private_data;
|
||||
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
+ unsigned long mask;
|
||||
+ char buf[32];
|
||||
+ ssize_t len;
|
||||
+
|
||||
+ len = min(count, sizeof(buf) - 1);
|
||||
+ if (copy_from_user(buf, user_buf, len))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ buf[len] = '\0';
|
||||
+ if (strict_strtoul(buf, 0, &mask))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ common->tx_chainmask = mask;
|
||||
+ sc->sc_ah->caps.tx_chainmask = mask;
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations fops_tx_chainmask = {
|
||||
+ .read = read_file_tx_chainmask,
|
||||
+ .write = write_file_tx_chainmask,
|
||||
+ .open = ath9k_debugfs_open,
|
||||
+ .owner = THIS_MODULE
|
||||
+};
|
||||
+
|
||||
+
|
||||
+static ssize_t read_file_rx_chainmask(struct file *file, char __user *user_buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct ath_softc *sc = file->private_data;
|
||||
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
+ char buf[32];
|
||||
+ unsigned int len;
|
||||
+
|
||||
+ len = snprintf(buf, sizeof(buf), "0x%08x\n", common->rx_chainmask);
|
||||
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
|
||||
+}
|
||||
+
|
||||
+static ssize_t write_file_rx_chainmask(struct file *file, const char __user *user_buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct ath_softc *sc = file->private_data;
|
||||
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
+ unsigned long mask;
|
||||
+ char buf[32];
|
||||
+ ssize_t len;
|
||||
+
|
||||
+ len = min(count, sizeof(buf) - 1);
|
||||
+ if (copy_from_user(buf, user_buf, len))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ buf[len] = '\0';
|
||||
+ if (strict_strtoul(buf, 0, &mask))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ common->rx_chainmask = mask;
|
||||
+ sc->sc_ah->caps.rx_chainmask = mask;
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations fops_rx_chainmask = {
|
||||
+ .read = read_file_rx_chainmask,
|
||||
+ .write = write_file_rx_chainmask,
|
||||
+ .open = ath9k_debugfs_open,
|
||||
+ .owner = THIS_MODULE
|
||||
+};
|
||||
+
|
||||
+
|
||||
static ssize_t read_file_dma(struct file *file, char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
@@ -731,6 +815,16 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
goto err;
|
||||
#endif
|
||||
|
||||
+ sc->debug.debugfs_rx_chainmask = debugfs_create_file("rx_chainmask",
|
||||
+ S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_rx_chainmask);
|
||||
+ if (!sc->debug.debugfs_rx_chainmask)
|
||||
+ goto err;
|
||||
+
|
||||
+ sc->debug.debugfs_tx_chainmask = debugfs_create_file("tx_chainmask",
|
||||
+ S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_tx_chainmask);
|
||||
+ if (!sc->debug.debugfs_tx_chainmask)
|
||||
+ goto err;
|
||||
+
|
||||
sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR,
|
||||
sc->debug.debugfs_phy, sc, &fops_dma);
|
||||
if (!sc->debug.debugfs_dma)
|
||||
@@ -781,6 +875,8 @@ void ath9k_exit_debug(struct ath_hw *ah)
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
struct ath_softc *sc = (struct ath_softc *) common->priv;
|
||||
|
||||
+ debugfs_remove(sc->debug.debugfs_tx_chainmask);
|
||||
+ debugfs_remove(sc->debug.debugfs_rx_chainmask);
|
||||
debugfs_remove(sc->debug.debugfs_recv);
|
||||
debugfs_remove(sc->debug.debugfs_xmit);
|
||||
debugfs_remove(sc->debug.debugfs_wiphy);
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.h
|
||||
@@ -152,6 +152,8 @@ struct ath_stats {
|
||||
};
|
||||
|
||||
struct ath9k_debug {
|
||||
+ struct dentry *debugfs_rx_chainmask;
|
||||
+ struct dentry *debugfs_tx_chainmask;
|
||||
struct dentry *debugfs_phy;
|
||||
struct dentry *debugfs_debug;
|
||||
struct dentry *debugfs_dma;
|
File diff suppressed because it is too large
Load Diff
@ -1,128 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.c
|
||||
@@ -795,6 +795,86 @@ static const struct file_operations fops
|
||||
.owner = THIS_MODULE
|
||||
};
|
||||
|
||||
+static ssize_t read_file_regidx(struct file *file, char __user *user_buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct ath_softc *sc = file->private_data;
|
||||
+ char buf[32];
|
||||
+ unsigned int len;
|
||||
+
|
||||
+ len = snprintf(buf, sizeof(buf), "0x%08x\n", sc->debug.regidx);
|
||||
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
|
||||
+}
|
||||
+
|
||||
+static ssize_t write_file_regidx(struct file *file, const char __user *user_buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct ath_softc *sc = file->private_data;
|
||||
+ unsigned long regidx;
|
||||
+ char buf[32];
|
||||
+ ssize_t len;
|
||||
+
|
||||
+ len = min(count, sizeof(buf) - 1);
|
||||
+ if (copy_from_user(buf, user_buf, len))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ buf[len] = '\0';
|
||||
+ if (strict_strtoul(buf, 0, ®idx))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ sc->debug.regidx = regidx;
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations fops_regidx = {
|
||||
+ .read = read_file_regidx,
|
||||
+ .write = write_file_regidx,
|
||||
+ .open = ath9k_debugfs_open,
|
||||
+ .owner = THIS_MODULE
|
||||
+};
|
||||
+
|
||||
+static ssize_t read_file_regval(struct file *file, char __user *user_buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct ath_softc *sc = file->private_data;
|
||||
+ struct ath_hw *ah = sc->sc_ah;
|
||||
+ char buf[32];
|
||||
+ unsigned int len;
|
||||
+ u32 regval;
|
||||
+
|
||||
+ regval = REG_READ_D(ah, sc->debug.regidx);
|
||||
+ len = snprintf(buf, sizeof(buf), "0x%08x\n", regval);
|
||||
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
|
||||
+}
|
||||
+
|
||||
+static ssize_t write_file_regval(struct file *file, const char __user *user_buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct ath_softc *sc = file->private_data;
|
||||
+ struct ath_hw *ah = sc->sc_ah;
|
||||
+ unsigned long regval;
|
||||
+ char buf[32];
|
||||
+ ssize_t len;
|
||||
+
|
||||
+ len = min(count, sizeof(buf) - 1);
|
||||
+ if (copy_from_user(buf, user_buf, len))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ buf[len] = '\0';
|
||||
+ if (strict_strtoul(buf, 0, ®val))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ REG_WRITE_D(ah, sc->debug.regidx, regval);
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations fops_regval = {
|
||||
+ .read = read_file_regval,
|
||||
+ .write = write_file_regval,
|
||||
+ .open = ath9k_debugfs_open,
|
||||
+ .owner = THIS_MODULE
|
||||
+};
|
||||
+
|
||||
int ath9k_init_debug(struct ath_hw *ah)
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
@@ -864,6 +944,17 @@ int ath9k_init_debug(struct ath_hw *ah)
|
||||
if (!sc->debug.debugfs_recv)
|
||||
goto err;
|
||||
|
||||
+ sc->debug.regidx = 0;
|
||||
+ sc->debug.debugfs_regidx = debugfs_create_file("regidx",
|
||||
+ S_IRUSR|S_IWUSR, sc->debug.debugfs_phy, sc, &fops_regidx);
|
||||
+ if (!sc->debug.debugfs_regidx)
|
||||
+ goto err;
|
||||
+
|
||||
+ sc->debug.debugfs_regval = debugfs_create_file("regval",
|
||||
+ S_IRUSR|S_IWUSR, sc->debug.debugfs_phy, sc, &fops_regval);
|
||||
+ if (!sc->debug.debugfs_regval)
|
||||
+ goto err;
|
||||
+
|
||||
return 0;
|
||||
err:
|
||||
ath9k_exit_debug(ah);
|
||||
@@ -877,6 +968,8 @@ void ath9k_exit_debug(struct ath_hw *ah)
|
||||
|
||||
debugfs_remove(sc->debug.debugfs_tx_chainmask);
|
||||
debugfs_remove(sc->debug.debugfs_rx_chainmask);
|
||||
+ debugfs_remove(sc->debug.debugfs_regval);
|
||||
+ debugfs_remove(sc->debug.debugfs_regidx);
|
||||
debugfs_remove(sc->debug.debugfs_recv);
|
||||
debugfs_remove(sc->debug.debugfs_xmit);
|
||||
debugfs_remove(sc->debug.debugfs_wiphy);
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.h
|
||||
@@ -162,6 +162,9 @@ struct ath9k_debug {
|
||||
struct dentry *debugfs_wiphy;
|
||||
struct dentry *debugfs_xmit;
|
||||
struct dentry *debugfs_recv;
|
||||
+ struct dentry *debugfs_regidx;
|
||||
+ struct dentry *debugfs_regval;
|
||||
+ u32 regidx;
|
||||
struct ath_stats stats;
|
||||
};
|
||||
|
@ -1,34 +0,0 @@
|
||||
--- a/net/wireless/core.h
|
||||
+++ b/net/wireless/core.h
|
||||
@@ -76,6 +76,7 @@ struct cfg80211_registered_device {
|
||||
|
||||
/* current channel */
|
||||
struct ieee80211_channel *channel;
|
||||
+ enum nl80211_channel_type channel_type;
|
||||
|
||||
/* must be last because of the way we do wiphy_priv(),
|
||||
* and it should at least be aligned to NETDEV_ALIGN */
|
||||
--- a/net/wireless/chan.c
|
||||
+++ b/net/wireless/chan.c
|
||||
@@ -97,6 +97,7 @@ int rdev_set_freq(struct cfg80211_regist
|
||||
return result;
|
||||
|
||||
rdev->channel = chan;
|
||||
+ rdev->channel_type = channel_type;
|
||||
|
||||
return 0;
|
||||
}
|
||||
--- a/net/wireless/nl80211.c
|
||||
+++ b/net/wireless/nl80211.c
|
||||
@@ -887,6 +887,11 @@ static int nl80211_send_iface(struct sk_
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
|
||||
NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name);
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype);
|
||||
+ if (rdev->channel) {
|
||||
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, rdev->channel->center_freq);
|
||||
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, rdev->channel_type);
|
||||
+ }
|
||||
+
|
||||
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_GENERATION,
|
||||
rdev->devlist_generation ^
|
File diff suppressed because it is too large
Load Diff
@ -1,24 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/common.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/common.c
|
||||
@@ -57,13 +57,19 @@ static bool ath9k_rx_accept(struct ath_c
|
||||
* rs_more indicates chained descriptors which can be used
|
||||
* to link buffers together for a sort of scatter-gather
|
||||
* operation.
|
||||
- *
|
||||
+ * reject the frame, we don't support scatter-gather yet and
|
||||
+ * the frame is probably corrupt anyway
|
||||
+ */
|
||||
+ if (rx_stats->rs_more)
|
||||
+ return false;
|
||||
+
|
||||
+ /*
|
||||
* The rx_stats->rs_status will not be set until the end of the
|
||||
* chained descriptors so it can be ignored if rs_more is set. The
|
||||
* rs_more will be false at the last element of the chained
|
||||
* descriptors.
|
||||
*/
|
||||
- if (!rx_stats->rs_more && rx_stats->rs_status != 0) {
|
||||
+ if (rx_stats->rs_status != 0) {
|
||||
if (rx_stats->rs_status & ATH9K_RXERR_CRC)
|
||||
rxs->flag |= RX_FLAG_FAILED_FCS_CRC;
|
||||
if (rx_stats->rs_status & ATH9K_RXERR_PHY)
|
Loading…
Reference in New Issue