diff mbox

[1/3] mt76: initialize available_antennas_{tx,rx} info

Message ID 20180224155414.31063-2-lorenzo.bianconi@redhat.com (mailing list archive)
State Accepted
Commit 24114a5f9470f75b47bdd6d40f4fc784326a9b58
Delegated to: Kalle Valo
Headers show

Commit Message

Lorenzo Bianconi Feb. 24, 2018, 3:54 p.m. UTC
Initialize available_antennas related info in wiphy data structure
according to antenna_mask field; antenna_mask info is initialized
in device specific code and will be used in mac80211 {set,get}_antenna
callbacks

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
---
 drivers/net/wireless/mediatek/mt76/mac80211.c    | 3 +++
 drivers/net/wireless/mediatek/mt76/mt76.h        | 2 ++
 drivers/net/wireless/mediatek/mt76/mt76x2_init.c | 3 +++
 3 files changed, 8 insertions(+)

Comments

Kalle Valo March 13, 2018, 4:32 p.m. UTC | #1
Lorenzo Bianconi <lorenzo.bianconi@redhat.com> wrote:

> Initialize available_antennas related info in wiphy data structure
> according to antenna_mask field; antenna_mask info is initialized
> in device specific code and will be used in mac80211 {set,get}_antenna
> callbacks
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

3 patches applied to wireless-drivers-next.git, thanks.

24114a5f9470 mt76: initialize available_antennas_{tx,rx} info
551e1ef4d291 mt76: add mt76_init_stream_cap routine
5ebdc3e0692f mt76x2: add mac80211 {set,get}_antenna callbacks
diff mbox

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 85f8d324ebf8..ec94b86a37fd 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -262,6 +262,9 @@  int mt76_register_device(struct mt76_dev *dev, bool vht,
 
 	wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR;
 
+	wiphy->available_antennas_tx = dev->antenna_mask;
+	wiphy->available_antennas_rx = dev->antenna_mask;
+
 	hw->txq_data_size = sizeof(struct mt76_txq);
 	hw->max_tx_fragments = 16;
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index d2ce15093edd..15009d5b0531 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -253,6 +253,8 @@  struct mt76_dev {
 	u32 rev;
 	unsigned long state;
 
+	u8 antenna_mask;
+
 	struct mt76_sband sband_2g;
 	struct mt76_sband sband_5g;
 	struct debugfs_blob_wrapper eeprom;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2_init.c
index 9dbf94947324..934c331d995e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_init.c
@@ -857,6 +857,9 @@  int mt76x2_register_device(struct mt76x2_dev *dev)
 	dev->mt76.led_cdev.brightness_set = mt76x2_led_set_brightness;
 	dev->mt76.led_cdev.blink_set = mt76x2_led_set_blink;
 
+	/* init antenna configuration */
+	dev->mt76.antenna_mask = 3;
+
 	ret = mt76_register_device(&dev->mt76, true, mt76x2_rates,
 				   ARRAY_SIZE(mt76x2_rates));
 	if (ret)