diff --git a/core/hdd/inc/wlan_hdd_wmm.h b/core/hdd/inc/wlan_hdd_wmm.h index c33d126c56..fa1c7048fa 100644 --- a/core/hdd/inc/wlan_hdd_wmm.h +++ b/core/hdd/inc/wlan_hdd_wmm.h @@ -1,5 +1,5 @@ /* - * 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,31 +242,21 @@ 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 + , void *accel_priv #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) - , select_queue_fallback_t fallback + , select_queue_fallback_t fallback #endif ); diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 4875bf0679..fd0da1733b 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -3085,7 +3085,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) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index b2d639d06c..51cd2f00cc 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3736,28 +3736,6 @@ static void hdd_set_multicast_list(struct net_device *dev) cds_ssr_unprotect(__func__); } -/** - * 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, diff --git a/core/hdd/src/wlan_hdd_wmm.c b/core/hdd/src/wlan_hdd_wmm.c index 4b348f6983..7310f4fffa 100644 --- a/core/hdd/src/wlan_hdd_wmm.c +++ b/core/hdd/src/wlan_hdd_wmm.c @@ -1,5 +1,5 @@ /* - * 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 @@ -1745,48 +1745,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. @@ -1796,7 +1754,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; @@ -1838,6 +1797,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