|
@@ -333,6 +333,37 @@ static void rt73usb_led_brightness(struct led_classdev *led_cdev,
|
|
/*
|
|
/*
|
|
* Configuration handlers.
|
|
* Configuration handlers.
|
|
*/
|
|
*/
|
|
|
|
+static void rt73usb_config_filter(struct rt2x00_dev *rt2x00dev,
|
|
|
|
+ const unsigned int filter_flags)
|
|
|
|
+{
|
|
|
|
+ u32 reg;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Start configuration steps.
|
|
|
|
+ * Note that the version error will always be dropped
|
|
|
|
+ * and broadcast frames will always be accepted since
|
|
|
|
+ * there is no filter for it at this time.
|
|
|
|
+ */
|
|
|
|
+ rt73usb_register_read(rt2x00dev, TXRX_CSR0, ®);
|
|
|
|
+ rt2x00_set_field32(®, TXRX_CSR0_DROP_CRC,
|
|
|
|
+ !(filter_flags & FIF_FCSFAIL));
|
|
|
|
+ rt2x00_set_field32(®, TXRX_CSR0_DROP_PHYSICAL,
|
|
|
|
+ !(filter_flags & FIF_PLCPFAIL));
|
|
|
|
+ rt2x00_set_field32(®, TXRX_CSR0_DROP_CONTROL,
|
|
|
|
+ !(filter_flags & FIF_CONTROL));
|
|
|
|
+ rt2x00_set_field32(®, TXRX_CSR0_DROP_NOT_TO_ME,
|
|
|
|
+ !(filter_flags & FIF_PROMISC_IN_BSS));
|
|
|
|
+ rt2x00_set_field32(®, TXRX_CSR0_DROP_TO_DS,
|
|
|
|
+ !(filter_flags & FIF_PROMISC_IN_BSS));
|
|
|
|
+ rt2x00_set_field32(®, TXRX_CSR0_DROP_VERSION_ERROR, 1);
|
|
|
|
+ rt2x00_set_field32(®, TXRX_CSR0_DROP_MULTICAST,
|
|
|
|
+ !(filter_flags & FIF_ALLMULTI));
|
|
|
|
+ rt2x00_set_field32(®, TXRX_CSR0_DROP_BROADCAST, 0);
|
|
|
|
+ rt2x00_set_field32(®, TXRX_CSR0_DROP_ACK_CTS,
|
|
|
|
+ !(filter_flags & FIF_CONTROL));
|
|
|
|
+ rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg);
|
|
|
|
+}
|
|
|
|
+
|
|
static void rt73usb_config_intf(struct rt2x00_dev *rt2x00dev,
|
|
static void rt73usb_config_intf(struct rt2x00_dev *rt2x00dev,
|
|
struct rt2x00_intf *intf,
|
|
struct rt2x00_intf *intf,
|
|
struct rt2x00intf_conf *conf,
|
|
struct rt2x00intf_conf *conf,
|
|
@@ -380,18 +411,11 @@ static void rt73usb_config_intf(struct rt2x00_dev *rt2x00dev,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-static int rt73usb_config_erp(struct rt2x00_dev *rt2x00dev,
|
|
|
|
- struct rt2x00lib_erp *erp)
|
|
|
|
|
|
+static void rt73usb_config_erp(struct rt2x00_dev *rt2x00dev,
|
|
|
|
+ struct rt2x00lib_erp *erp)
|
|
{
|
|
{
|
|
u32 reg;
|
|
u32 reg;
|
|
|
|
|
|
- /*
|
|
|
|
- * When in atomic context, we should let rt2x00lib
|
|
|
|
- * try this configuration again later.
|
|
|
|
- */
|
|
|
|
- if (in_atomic())
|
|
|
|
- return -EAGAIN;
|
|
|
|
-
|
|
|
|
rt73usb_register_read(rt2x00dev, TXRX_CSR0, ®);
|
|
rt73usb_register_read(rt2x00dev, TXRX_CSR0, ®);
|
|
rt2x00_set_field32(®, TXRX_CSR0_RX_ACK_TIMEOUT, erp->ack_timeout);
|
|
rt2x00_set_field32(®, TXRX_CSR0_RX_ACK_TIMEOUT, erp->ack_timeout);
|
|
rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg);
|
|
rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg);
|
|
@@ -400,8 +424,6 @@ static int rt73usb_config_erp(struct rt2x00_dev *rt2x00dev,
|
|
rt2x00_set_field32(®, TXRX_CSR4_AUTORESPOND_PREAMBLE,
|
|
rt2x00_set_field32(®, TXRX_CSR4_AUTORESPOND_PREAMBLE,
|
|
!!erp->short_preamble);
|
|
!!erp->short_preamble);
|
|
rt73usb_register_write(rt2x00dev, TXRX_CSR4, reg);
|
|
rt73usb_register_write(rt2x00dev, TXRX_CSR4, reg);
|
|
-
|
|
|
|
- return 0;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static void rt73usb_config_phymode(struct rt2x00_dev *rt2x00dev,
|
|
static void rt73usb_config_phymode(struct rt2x00_dev *rt2x00dev,
|
|
@@ -1872,6 +1894,7 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
|
|
* This device requires firmware.
|
|
* This device requires firmware.
|
|
*/
|
|
*/
|
|
__set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
|
|
__set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
|
|
|
|
+ __set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags);
|
|
|
|
|
|
/*
|
|
/*
|
|
* Set the rssi offset.
|
|
* Set the rssi offset.
|
|
@@ -1884,80 +1907,6 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
|
|
/*
|
|
/*
|
|
* IEEE80211 stack callback functions.
|
|
* IEEE80211 stack callback functions.
|
|
*/
|
|
*/
|
|
-static void rt73usb_configure_filter(struct ieee80211_hw *hw,
|
|
|
|
- unsigned int changed_flags,
|
|
|
|
- unsigned int *total_flags,
|
|
|
|
- int mc_count,
|
|
|
|
- struct dev_addr_list *mc_list)
|
|
|
|
-{
|
|
|
|
- struct rt2x00_dev *rt2x00dev = hw->priv;
|
|
|
|
- u32 reg;
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * Mask off any flags we are going to ignore from
|
|
|
|
- * the total_flags field.
|
|
|
|
- */
|
|
|
|
- *total_flags &=
|
|
|
|
- FIF_ALLMULTI |
|
|
|
|
- FIF_FCSFAIL |
|
|
|
|
- FIF_PLCPFAIL |
|
|
|
|
- FIF_CONTROL |
|
|
|
|
- FIF_OTHER_BSS |
|
|
|
|
- FIF_PROMISC_IN_BSS;
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * Apply some rules to the filters:
|
|
|
|
- * - Some filters imply different filters to be set.
|
|
|
|
- * - Some things we can't filter out at all.
|
|
|
|
- * - Multicast filter seems to kill broadcast traffic so never use it.
|
|
|
|
- */
|
|
|
|
- *total_flags |= FIF_ALLMULTI;
|
|
|
|
- if (*total_flags & FIF_OTHER_BSS ||
|
|
|
|
- *total_flags & FIF_PROMISC_IN_BSS)
|
|
|
|
- *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * Check if there is any work left for us.
|
|
|
|
- */
|
|
|
|
- if (rt2x00dev->packet_filter == *total_flags)
|
|
|
|
- return;
|
|
|
|
- rt2x00dev->packet_filter = *total_flags;
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * When in atomic context, reschedule and let rt2x00lib
|
|
|
|
- * call this function again.
|
|
|
|
- */
|
|
|
|
- if (in_atomic()) {
|
|
|
|
- queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->filter_work);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * Start configuration steps.
|
|
|
|
- * Note that the version error will always be dropped
|
|
|
|
- * and broadcast frames will always be accepted since
|
|
|
|
- * there is no filter for it at this time.
|
|
|
|
- */
|
|
|
|
- rt73usb_register_read(rt2x00dev, TXRX_CSR0, ®);
|
|
|
|
- rt2x00_set_field32(®, TXRX_CSR0_DROP_CRC,
|
|
|
|
- !(*total_flags & FIF_FCSFAIL));
|
|
|
|
- rt2x00_set_field32(®, TXRX_CSR0_DROP_PHYSICAL,
|
|
|
|
- !(*total_flags & FIF_PLCPFAIL));
|
|
|
|
- rt2x00_set_field32(®, TXRX_CSR0_DROP_CONTROL,
|
|
|
|
- !(*total_flags & FIF_CONTROL));
|
|
|
|
- rt2x00_set_field32(®, TXRX_CSR0_DROP_NOT_TO_ME,
|
|
|
|
- !(*total_flags & FIF_PROMISC_IN_BSS));
|
|
|
|
- rt2x00_set_field32(®, TXRX_CSR0_DROP_TO_DS,
|
|
|
|
- !(*total_flags & FIF_PROMISC_IN_BSS));
|
|
|
|
- rt2x00_set_field32(®, TXRX_CSR0_DROP_VERSION_ERROR, 1);
|
|
|
|
- rt2x00_set_field32(®, TXRX_CSR0_DROP_MULTICAST,
|
|
|
|
- !(*total_flags & FIF_ALLMULTI));
|
|
|
|
- rt2x00_set_field32(®, TXRX_CSR0_DROP_BROADCAST, 0);
|
|
|
|
- rt2x00_set_field32(®, TXRX_CSR0_DROP_ACK_CTS,
|
|
|
|
- !(*total_flags & FIF_CONTROL));
|
|
|
|
- rt73usb_register_write(rt2x00dev, TXRX_CSR0, reg);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int rt73usb_set_retry_limit(struct ieee80211_hw *hw,
|
|
static int rt73usb_set_retry_limit(struct ieee80211_hw *hw,
|
|
u32 short_retry, u32 long_retry)
|
|
u32 short_retry, u32 long_retry)
|
|
{
|
|
{
|
|
@@ -2067,7 +2016,7 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = {
|
|
.remove_interface = rt2x00mac_remove_interface,
|
|
.remove_interface = rt2x00mac_remove_interface,
|
|
.config = rt2x00mac_config,
|
|
.config = rt2x00mac_config,
|
|
.config_interface = rt2x00mac_config_interface,
|
|
.config_interface = rt2x00mac_config_interface,
|
|
- .configure_filter = rt73usb_configure_filter,
|
|
|
|
|
|
+ .configure_filter = rt2x00mac_configure_filter,
|
|
.get_stats = rt2x00mac_get_stats,
|
|
.get_stats = rt2x00mac_get_stats,
|
|
.set_retry_limit = rt73usb_set_retry_limit,
|
|
.set_retry_limit = rt73usb_set_retry_limit,
|
|
.bss_info_changed = rt2x00mac_bss_info_changed,
|
|
.bss_info_changed = rt2x00mac_bss_info_changed,
|
|
@@ -2096,6 +2045,7 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = {
|
|
.get_tx_data_len = rt73usb_get_tx_data_len,
|
|
.get_tx_data_len = rt73usb_get_tx_data_len,
|
|
.kick_tx_queue = rt73usb_kick_tx_queue,
|
|
.kick_tx_queue = rt73usb_kick_tx_queue,
|
|
.fill_rxdone = rt73usb_fill_rxdone,
|
|
.fill_rxdone = rt73usb_fill_rxdone,
|
|
|
|
+ .config_filter = rt73usb_config_filter,
|
|
.config_intf = rt73usb_config_intf,
|
|
.config_intf = rt73usb_config_intf,
|
|
.config_erp = rt73usb_config_erp,
|
|
.config_erp = rt73usb_config_erp,
|
|
.config = rt73usb_config,
|
|
.config = rt73usb_config,
|