Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9aa3435 authored by Manjunathappa Prakash's avatar Manjunathappa Prakash Committed by nshrivas
Browse files

qcacld-3.0: converge STA and SAP ndo_select_queue net_device_ops

Converge on STA and SAP ndo_select_queue net_device_ops implementation.

Change-Id: Ia8d5177be3718a52d5c2eabaf83212c3a864d679
CRs-Fixed: 2389052
parent 40dc44d8
Loading
Loading
Loading
Loading
+10 −20
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2012,2016-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2012,2016-2019 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -242,26 +242,16 @@ QDF_STATUS hdd_wmm_adapter_init(struct hdd_adapter *adapter);
QDF_STATUS hdd_wmm_adapter_close(struct hdd_adapter *adapter);

/**
 * hdd_wmm_select_queue() - Function which will classify the packet
 *       according to linux qdisc expectation.
 * hdd_select_queue() - Return queue to be used.
 * @dev:	Pointer to the WLAN device.
 * @skb:	Pointer to OS packet (sk_buff).
 *
 * @dev: [in] pointer to net_device structure
 * @skb: [in] pointer to os packet
 * This function is registered with the Linux OS for network
 * core to decide which queue to use for the skb.
 *
 * Return: Qdisc queue index
 * Return: Qdisc queue index.
 */
uint16_t hdd_wmm_select_queue(struct net_device *dev, struct sk_buff *skb);

/**
 * hdd_hostapd_select_queue() - Function which will classify the packet
 *       according to linux qdisc expectation.
 *
 * @dev: [in] pointer to net_device structure
 * @skb: [in] pointer to os packet
 *
 * Return: Qdisc queue index
 */
uint16_t hdd_hostapd_select_queue(struct net_device *dev, struct sk_buff *skb
uint16_t hdd_select_queue(struct net_device *dev, struct sk_buff *skb
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
			  , void *accel_priv
#endif
+1 −1
Original line number Diff line number Diff line
@@ -6266,7 +6266,7 @@ const struct net_device_ops net_ops_struct = {
	.ndo_set_mac_address = hdd_hostapd_set_mac_address,
	.ndo_do_ioctl = hdd_ioctl,
	.ndo_change_mtu = hdd_hostapd_change_mtu,
	.ndo_select_queue = hdd_hostapd_select_queue,
	.ndo_select_queue = hdd_select_queue,
};

void hdd_set_ap_ops(struct net_device *dev)
+0 −22
Original line number Diff line number Diff line
@@ -3922,28 +3922,6 @@ static void hdd_set_multicast_list(struct net_device *dev)
}
#endif

/**
 * hdd_select_queue() - used by Linux OS to decide which queue to use first
 * @dev:	Pointer to the WLAN device.
 * @skb:	Pointer to OS packet (sk_buff).
 *
 * This function is registered with the Linux OS for network
 * core to decide which queue to use first.
 *
 * Return: ac, Queue Index/access category corresponding to UP in IP header
 */
static uint16_t hdd_select_queue(struct net_device *dev, struct sk_buff *skb
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
			  , void *accel_priv
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
			  , select_queue_fallback_t fallback
#endif
)
{
	return hdd_wmm_select_queue(dev, skb);
}

static const struct net_device_ops wlan_drv_ops = {
	.ndo_open = hdd_open,
	.ndo_stop = hdd_stop,
+15 −44
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -1556,48 +1556,6 @@ uint16_t hdd_get_queue_index(uint16_t up, bool is_eapol)
}
#endif


/**
 * hdd_hostapd_select_queue() - Function which will classify the packet
 *       according to linux qdisc expectation.
 *
 * @dev: [in] pointer to net_device structure
 * @skb: [in] pointer to os packet
 *
 * Return: Qdisc queue index
 */
uint16_t hdd_hostapd_select_queue(struct net_device *dev, struct sk_buff *skb
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
				  , void *accel_priv
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
				  , select_queue_fallback_t fallback
#endif

)
{
	enum sme_qos_wmmuptype up = SME_QOS_WMM_UP_BE;
	uint16_t queueIndex;
	struct hdd_adapter *adapter = (struct hdd_adapter *) netdev_priv(dev);
	struct hdd_context *hddctx = WLAN_HDD_GET_CTX(adapter);
	bool is_eapol = false;
	int status = 0;

	status = wlan_hdd_validate_context(hddctx);

	if (status != 0) {
		skb->priority = SME_QOS_WMM_UP_BE;
		return HDD_LINUX_AC_BE;
	}

	/* Get the user priority from IP header */
	hdd_wmm_classify_pkt(adapter, skb, &up, &is_eapol);
	skb->priority = up;
	queueIndex = hdd_get_queue_index(skb->priority, is_eapol);

	return queueIndex;
}

/**
 * hdd_wmm_select_queue() - Function which will classify the packet
 *       according to linux qdisc expectation.
@@ -1607,7 +1565,8 @@ uint16_t hdd_hostapd_select_queue(struct net_device *dev, struct sk_buff *skb
 *
 * Return: Qdisc queue index
 */
uint16_t hdd_wmm_select_queue(struct net_device *dev, struct sk_buff *skb)
static uint16_t hdd_wmm_select_queue(struct net_device *dev,
				     struct sk_buff *skb)
{
	enum sme_qos_wmmuptype up = SME_QOS_WMM_UP_BE;
	uint16_t queueIndex;
@@ -1649,6 +1608,18 @@ uint16_t hdd_wmm_select_queue(struct net_device *dev, struct sk_buff *skb)
	return queueIndex;
}

uint16_t hdd_select_queue(struct net_device *dev, struct sk_buff *skb
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
			  , void *accel_priv
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
			  , select_queue_fallback_t fallback
#endif
)
{
	return hdd_wmm_select_queue(dev, skb);
}

/**
 * hdd_wmm_acquire_access_required() - Function which will determine
 * acquire admittance for a WMM AC is required or not based on psb configuration