Explorar o código

qcacld-3.0: Update the net device setup for monitor mode

Netdevice setup for the Monitor mode/Device mode are different
with Dynamic mode change the adapter is allocated for normal mode
and the device setup is done according to the normal modes.
Once the device mode change request for monitor mode comes via con_mode
the driver shall change to monitor mode, when the mode switch happens
presently driver is using the same setup as station in monitor mode.

Update the net device setup for the monitor mode once the device changes
to monitor mode.

Change-Id: I38ff0e31b80f8e800a37c10431902ab092b627ba
CRs-Fixed: 1064063
Arun Khandavalli %!s(int64=8) %!d(string=hai) anos
pai
achega
f5c0e0cf0c
Modificáronse 1 ficheiros con 21 adicións e 20 borrados
  1. 21 20
      core/hdd/src/wlan_hdd_main.c

+ 21 - 20
core/hdd/src/wlan_hdd_main.c

@@ -1563,6 +1563,26 @@ bool hdd_is_valid_mac_address(const uint8_t *pMacAddr)
 	return xdigit == 12 && (separator == 5 || separator == 0);
 }
 
+/**
+ * hdd_mon_mode_ether_setup() - Update monitor mode struct net_device.
+ * @dev: Handle to struct net_device to be updated.
+ *
+ * Return: None
+ */
+static void hdd_mon_mode_ether_setup(struct net_device *dev)
+{
+	dev->header_ops         = NULL;
+	dev->type               = ARPHRD_IEEE80211_RADIOTAP;
+	dev->hard_header_len    = ETH_HLEN;
+	dev->mtu                = ETH_DATA_LEN;
+	dev->addr_len           = ETH_ALEN;
+	dev->tx_queue_len       = 1000; /* Ethernet wants good queues */
+	dev->flags              = IFF_BROADCAST|IFF_MULTICAST;
+	dev->priv_flags        |= IFF_TX_SKB_SHARING;
+
+	memset(dev->broadcast, 0xFF, ETH_ALEN);
+}
+
 /**
  * __hdd__mon_open() - HDD Open function
  * @dev: Pointer to net_device structure
@@ -1576,6 +1596,7 @@ static int __hdd_mon_open(struct net_device *dev)
 	int ret;
 
 	ENTER_DEV(dev);
+	hdd_mon_mode_ether_setup(dev);
 	ret = hdd_set_mon_rx_cb(dev);
 	return ret;
 }
@@ -2334,26 +2355,6 @@ void hdd_set_station_ops(struct net_device *pWlanDev)
 		pWlanDev->netdev_ops = &wlan_drv_ops;
 }
 
-/**
- * hdd_mon_mode_ether_setup() - Update monitor mode struct net_device.
- * @dev: Handle to struct net_device to be updated.
- *
- * Return: None
- */
-static void hdd_mon_mode_ether_setup(struct net_device *dev)
-{
-	dev->header_ops         = NULL;
-	dev->type               = ARPHRD_IEEE80211_RADIOTAP;
-	dev->hard_header_len    = ETH_HLEN;
-	dev->mtu                = ETH_DATA_LEN;
-	dev->addr_len           = ETH_ALEN;
-	dev->tx_queue_len       = 1000; /* Ethernet wants good queues */
-	dev->flags              = IFF_BROADCAST|IFF_MULTICAST;
-	dev->priv_flags        |= IFF_TX_SKB_SHARING;
-
-	memset(dev->broadcast, 0xFF, ETH_ALEN);
-}
-
 /**
  * hdd_alloc_station_adapter() - allocate the station hdd adapter
  * @hdd_ctx: global hdd context