}
EXPORT_SYMBOL_GPL(mt7615_mac_init);
+void mt7615_check_offload_capability(struct mt7615_dev *dev)
+{
+ struct ieee80211_hw *hw = mt76_hw(dev);
+ struct wiphy *wiphy = hw->wiphy;
+
+ if (mt7615_firmware_offload(dev)) {
+ ieee80211_hw_set(hw, SUPPORTS_PS);
+ ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS);
+
+ wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
+ } else {
+ dev->ops->hw_scan = NULL;
+ dev->ops->cancel_hw_scan = NULL;
+ dev->ops->sched_scan_start = NULL;
+ dev->ops->sched_scan_stop = NULL;
+
+ wiphy->max_sched_scan_plan_interval = 0;
+ wiphy->max_sched_scan_ie_len = 0;
+ wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
+ wiphy->max_sched_scan_ssids = 0;
+ wiphy->max_match_sets = 0;
+ wiphy->max_sched_scan_reqs = 0;
+ }
+}
+EXPORT_SYMBOL_GPL(mt7615_check_offload_capability);
+
bool mt7615_wait_for_mcu_init(struct mt7615_dev *dev)
{
flush_work(&dev->mcu_work);
int irq, const u32 *map);
u32 mt7615_reg_map(struct mt7615_dev *dev, u32 addr);
+void mt7615_check_offload_capability(struct mt7615_dev *dev);
void mt7615_init_device(struct mt7615_dev *dev);
int mt7615_register_device(struct mt7615_dev *dev);
void mt7615_unregister_device(struct mt7615_dev *dev);
{
struct mt7615_dev *dev = container_of(work, struct mt7615_dev,
mcu_work);
- struct ieee80211_hw *hw = mt76_hw(dev);
if (mt7615_mcu_init(dev))
return;
mt7615_mac_init(dev);
mt7615_phy_init(dev);
mt7615_mcu_del_wtbl_all(dev);
-
- if (mt7615_firmware_offload(dev)) {
- ieee80211_hw_set(hw, SUPPORTS_PS);
- ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS);
- } else {
- struct wiphy *wiphy = hw->wiphy;
-
- dev->ops->hw_scan = NULL;
- dev->ops->cancel_hw_scan = NULL;
- dev->ops->sched_scan_start = NULL;
- dev->ops->sched_scan_stop = NULL;
-
- wiphy->max_sched_scan_plan_interval = 0;
- wiphy->max_sched_scan_ie_len = 0;
- wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
- wiphy->max_sched_scan_ssids = 0;
- wiphy->max_match_sets = 0;
- wiphy->max_sched_scan_reqs = 0;
- }
+ mt7615_check_offload_capability(dev);
}
static int mt7615_init_hardware(struct mt7615_dev *dev)
mt7615_mac_init(dev);
mt7615_phy_init(dev);
mt7615_mcu_del_wtbl_all(dev);
+ mt7615_check_offload_capability(dev);
}
int mt7663u_register_device(struct mt7615_dev *dev)
if (err)
return err;
- ieee80211_hw_set(hw, SUPPORTS_PS);
- ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS);
-
hw->extra_tx_headroom += MT_USB_HDR_SIZE + MT_USB_TXD_SIZE;
/* check hw sg support in order to enable AMSDU */
hw->max_tx_fragments = dev->mt76.usb.sg_en ? MT_HW_TXP_MAX_BUF_NUM : 1;