staging: csr: Remove kernel version checks
cover staging: csr: Remove kernel version checks
This patchset removes the unneeded kernel version checks and associated compatibility defines and macros from the csr driver.
PATCH 1/14 staging: csr: netdev.c: Clean up KERNEL_VERSION checks: <=2.6.25
--- drivers/staging/csr/netdev.c | 21 --------------------- 1 file changed, 21 deletions(-)
drivers/staging/csr/netdev.c +0 -21
@@ -53,9 +53,6 @@#include "csr_wifi_hip_unifi.h" #include "csr_wifi_hip_conversions.h" #include "unifi_priv.h" -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,13 ) -#include <net/iw_handler.h> -#endif #include <net/pkt_sched.h>
@@ -189,13 +186,8 @@ static struct sk_buff *uf_qdiscop_dequeue(struct Qdisc* qd);static void uf_qdiscop_reset (struct Qdisc * qd);static void uf_qdiscop_destroy (struct Qdisc * qd);static int uf_qdiscop_dump (struct Qdisc *qd,struct sk_buff *skb); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,25 )static int uf_qdiscop_tune (struct Qdisc *qd,struct nlattr *opt);static int uf_qdiscop_init (struct Qdisc *qd,struct nlattr *opt); -#else -static int uf_qdiscop_tune (struct Qdisc *qd,struct rtattr *opt); -static int uf_qdiscop_init (struct Qdisc *qd,struct rtattr *opt); -#endif #endif
@@ -227,9 +219,6 @@ static struct Qdisc_ops uf_qdisc_ops =#elif LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 )#define UF_QDISC_CREATE_DFLT (_dev, _ops, _root) \ qdisc_create_dflt(dev, netdev_get_tx_queue(_dev, 0), _ops, _root) -#elif LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,20 ) -#define UF_QDISC_CREATE_DFLT (_dev, _ops, _root) \ - qdisc_create_dflt(dev, _ops, _root)#else #define UF_QDISC_CREATE_DFLT (_dev, _ops, _root) \ qdisc_create_dflt(dev, _ops)
@@ -700,10 +689,8 @@ uf_free_netdevice(unifi_priv_t *priv)#ifdef CSR_SUPPORT_SME /* Cancel work items and destroy the workqueue */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,23 )cancel_work_sync (&priv->multicast_list_task);#endif -#endif /* Destroy the workqueues. */ flush_workqueue (priv->unifi_workqueue);destroy_workqueue (priv->unifi_workqueue);
@@ -3480,11 +3467,7 @@ static void uf_qdiscop_destroy(struct Qdisc* qd)/* called whenever parameters are updated on existing qdisc */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,25 )static int uf_qdiscop_tune (struct Qdisc *qd,struct nlattr *opt) -#else -static int uf_qdiscop_tune(struct Qdisc *qd, struct rtattr *opt) -#endif {func_enter ();func_exit ();
@@ -3493,11 +3476,7 @@ static int uf_qdiscop_tune(struct Qdisc *qd, struct rtattr *opt)/* called during initial creation of qdisc on device */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,25 )static int uf_qdiscop_init (struct Qdisc *qd,struct nlattr *opt) -#else -static int uf_qdiscop_init(struct Qdisc *qd, struct rtattr *opt) -#endif {#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 )struct net_device *dev = qd->dev_queue->dev;
Signature · 1 line
1.7.12
PATCH 2/14 staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.27
In reply to Priit Laes--- drivers/staging/csr/netdev.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-)
drivers/staging/csr/netdev.c +0 -42
@@ -216,9 +216,6 @@ static struct Qdisc_ops uf_qdisc_ops =#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 )#define UF_QDISC_CREATE_DFLT (_dev, _ops, _root) -#elif LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 ) -#define UF_QDISC_CREATE_DFLT (_dev, _ops, _root) \ - qdisc_create_dflt(dev, netdev_get_tx_queue(_dev, 0), _ops, _root)#else #define UF_QDISC_CREATE_DFLT (_dev, _ops, _root) \ qdisc_create_dflt(dev, _ops)
@@ -2338,8 +2335,6 @@ uf_resume_data_plane(unifi_priv_t *priv, int queue,if (netif_running (priv->netdev[interfaceTag])) {#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 )netif_tx_schedule_all (priv->netdev[interfaceTag]); -#elif LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 ) -netif_schedule_queue (netdev_get_tx_queue (priv->netdev[interfaceTag],0 ));#else netif_schedule (priv->netdev[interfaceTag]);#endif /* LINUX_VERSION_CODE */
@@ -3199,25 +3194,11 @@ void uf_net_get_name(struct net_device *dev, char *name, int len)int uf_install_qdisc (struct net_device *dev) {struct Qdisc *qdisc; -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 )struct netdev_queue *queue0; -#endif /* LINUX_VERSION_CODE */ func_enter (); -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,27 ) -/* -* check that there is no qdisc currently attached to device -* this ensures that we will be the root qdisc. (I can't find a better -* way to test this explicitly) -*/ -if (dev->qdisc_sleeping != &noop_qdisc) { -func_exit_r (-EFAULT ); -return -EINVAL ; - } -#endif /* LINUX_VERSION_CODE */ - qdisc =UF_QDISC_CREATE_DFLT (dev, &uf_qdisc_ops,TC_H_ROOT );if (!qdisc) {unifi_error (NULL ,"%s: qdisc installation failed\n" , dev->name);
@@ -3230,7 +3211,6 @@ int uf_install_qdisc(struct net_device *dev) qdisc->handle =0x80020000 ; qdisc->flags =0x0 ; -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 ) queue0 =netdev_get_tx_queue (dev,0 );if (queue0 ==NULL ) { unifi_error(NULL, "%s: netdev_get_tx_queue returned no queue\n",
@@ -3240,12 +3220,6 @@ int uf_install_qdisc(struct net_device *dev) } queue0->qdisc = qdisc; queue0->qdisc_sleeping = qdisc; -#else -qdisc_lock_tree (dev); -list_add_tail (&qdisc->list, &dev->qdisc_list); - dev->qdisc_sleeping = qdisc; -qdisc_unlock_tree (dev); -#endif /* LINUX_VERSION_CODE */ func_exit_r (0 );return 0 ;
@@ -3254,11 +3228,7 @@ int uf_install_qdisc(struct net_device *dev)static int uf_qdiscop_enqueue (struct sk_buff *skb,struct Qdisc * qd) { -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 )netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (qd->dev_queue->dev); -#else -netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (qd->dev); -#endif /* LINUX_VERSION_CODE */ unifi_priv_t *priv = interfacePriv->privPtr;struct uf_sched_data *q =qdisc_priv (qd);struct uf_tx_packet_data *pkt_data = (struct uf_tx_packet_data *) skb->cb;
@@ -3305,11 +3275,7 @@ static int uf_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)static int uf_qdiscop_requeue (struct sk_buff *skb,struct Qdisc * qd) { -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 )netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (qd->dev_queue->dev); -#else -netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (qd->dev); -#endif /* LINUX_VERSION_CODE */ unifi_priv_t *priv = interfacePriv->privPtr;struct uf_sched_data *q =qdisc_priv (qd);struct uf_tx_packet_data *pkt_data = (struct uf_tx_packet_data *) skb->cb;
@@ -3339,11 +3305,7 @@ static int uf_qdiscop_requeue(struct sk_buff *skb, struct Qdisc* qd)static struct sk_buff *uf_qdiscop_dequeue (struct Qdisc * qd) { -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 )netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (qd->dev_queue->dev); -#else -netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (qd->dev); -#endif /* LINUX_VERSION_CODE */ unifi_priv_t *priv = interfacePriv->privPtr;struct uf_sched_data *q =qdisc_priv (qd);struct sk_buff *skb;
@@ -3478,11 +3440,7 @@ static int uf_qdiscop_tune(struct Qdisc *qd, struct nlattr *opt)/* called during initial creation of qdisc on device */ static int uf_qdiscop_init (struct Qdisc *qd,struct nlattr *opt) { -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 )struct net_device *dev = qd->dev_queue->dev; -#else -struct net_device *dev = qd->dev; -#endif /* LINUX_VERSION_CODE */ netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (dev);unifi_priv_t *priv = interfacePriv->privPtr;struct uf_sched_data *q =qdisc_priv (qd);
Signature · 1 line
1.7.12
PATCH 3/14 staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.28
In reply to Priit Laes--- drivers/staging/csr/netdev.c | 454 ------------------------------------------- 1 file changed, 454 deletions(-)
drivers/staging/csr/netdev.c +0 -454
@@ -67,7 +67,6 @@*/ #define ALLOW_Q_PAUSE -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 )#ifdef UNIFI_NET_NAME #define UF_ALLOC_NETDEV (_dev, _size, _name, _setup, _num_of_queues) \ do { \
@@ -81,21 +80,6 @@ _dev = alloc_etherdev_mq(_size, _num_of_queues); \ }while (0 );#endif /* UNIFI_NET_NAME */ -#else -#ifdef UNIFI_NET_NAME -#define UF_ALLOC_NETDEV (_dev, _size, _name, _setup, _num_of_queues) \ - do { \ - static char name[8]; \ - sprintf(name, "%s%s", UNIFI_NET_NAME, _name); \ - _dev = alloc_netdev(_size, name, _setup); \ - } while (0); -#else -#define UF_ALLOC_NETDEV (_dev, _size, _name, _setup, _num_of_queues) \ - do { \ - _dev = alloc_etherdev(_size); \ - } while (0); -#endif /* UNIFI_NET_NAME */ -#endif /* LINUX_VERSION_CODE */ /* Wext handler is suported only if CSR_SUPPORT_WEXT is defined */
@@ -116,9 +100,7 @@ static int uf_net_open(struct net_device *dev);static int uf_net_ioctl (struct net_device *dev,struct ifreq *rq,int cmd);static int uf_net_stop (struct net_device *dev);static struct net_device_stats *uf_net_get_stats (struct net_device *dev); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 )static u16 uf_net_select_queue (struct net_device *dev,struct sk_buff *skb); -#endif #if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )static netdev_tx_t uf_net_xmit (struct sk_buff *skb,struct net_device *dev);#else
@@ -179,48 +161,6 @@ struct uf_tx_packet_data { unsigned long host_tag; }; -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,28 ) -static int uf_qdiscop_enqueue (struct sk_buff *skb,struct Qdisc * qd); -static int uf_qdiscop_requeue (struct sk_buff *skb,struct Qdisc * qd); -static struct sk_buff *uf_qdiscop_dequeue (struct Qdisc * qd); -static void uf_qdiscop_reset (struct Qdisc * qd); -static void uf_qdiscop_destroy (struct Qdisc * qd); -static int uf_qdiscop_dump (struct Qdisc *qd,struct sk_buff *skb); -static int uf_qdiscop_tune (struct Qdisc *qd,struct nlattr *opt); -static int uf_qdiscop_init (struct Qdisc *qd,struct nlattr *opt); -#endif - - -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,28 ) -/* queueing discipline operations */ -static struct Qdisc_ops uf_qdisc_ops = -{ - .next =NULL , - .cl_ops =NULL , - .id ="UniFi Qdisc" , - .priv_size =sizeof (struct uf_sched_data ), - - .enqueue = uf_qdiscop_enqueue, - .dequeue = uf_qdiscop_dequeue, - .requeue = uf_qdiscop_requeue, - .drop =NULL ,/* drop not needed since we are always the root qdisc */ - - .init = uf_qdiscop_init, - .reset = uf_qdiscop_reset, - .destroy = uf_qdiscop_destroy, - .change = uf_qdiscop_tune, - - .dump = uf_qdiscop_dump, -}; -#endif /* LINUX_VERSION_CODE */ - -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 ) -#define UF_QDISC_CREATE_DFLT (_dev, _ops, _root) -#else -#define UF_QDISC_CREATE_DFLT (_dev, _ops, _root) \ - qdisc_create_dflt(dev, _ops) -#endif /* LINUX_VERSION_CODE */ -#endif /* CONFIG_NET_SCHED */ #if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,29 )
@@ -330,10 +270,8 @@ uf_alloc_netdevice(CsrSdioFunction *sdio_dev, int bus_id) dev->get_stats = uf_net_get_stats; dev->set_multicast_list = uf_set_multicast_list; -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 ) dev->select_queue = uf_net_select_queue;#endif -#endif #ifdef CSR_SUPPORT_WEXT dev->wireless_handlers = &unifi_iw_handler_def;
@@ -473,16 +411,8 @@ uf_alloc_netdevice(CsrSdioFunction *sdio_dev, int bus_id)#endif #endif -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,28 ) -#ifdef CONFIG_NET_SCHED -/* Register the qdisc operations */ -register_qdisc (&uf_qdisc_ops); -#endif /* CONFIG_NET_SCHED */ -#endif /* LINUX_VERSION_CODE */ - priv->ref_count =1 ; - priv->amp_client =NULL ; priv->coredump_mode =0 ; priv->ptest_mode =0 ;
@@ -672,13 +602,6 @@ uf_free_netdevice(unifi_priv_t *priv)spin_unlock_irqrestore (&priv->wapi_lock, flags);#endif -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,28 ) -#ifdef CONFIG_NET_SCHED -/* Unregister the qdisc operations */ -unregister_qdisc (&uf_qdisc_ops); -#endif /* CONFIG_NET_SCHED */ -#endif /* LINUX_VERSION_CODE */ -#ifdef CSR_SUPPORT_WEXT /* Unregister callback for netdevice state changes */ unregister_netdevice_notifier (&uf_netdev_notifier);
@@ -941,7 +864,6 @@ get_packet_priority(unifi_priv_t *priv, struct sk_buff *skb, const struct ethhdrreturn priority; } -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 )/* * --------------------------------------------------------------------------- * uf_net_select_queue
@@ -989,7 +911,6 @@ uf_net_select_queue(struct net_device *dev, struct sk_buff *skb)func_exit ();return (u16 )queue; }/* uf_net_select_queue() */ -#endif int skb_add_llc_snap (struct net_device *dev,struct sk_buff *skb,int proto)
@@ -1913,9 +1834,7 @@ uf_net_xmit(struct sk_buff *skb, struct net_device *dev)int result;static tx_signal_handler tx_handler;CSR_PRIORITY priority; -#if !defined (CONFIG_NET_SCHED ) || (LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 ))CsrWifiRouterCtrlPortAction port_action; -#endif /* CONFIG_NET_SCHED */ func_enter ();
@@ -1940,11 +1859,6 @@ uf_net_xmit(struct sk_buff *skb, struct net_device *dev) port =UF_UNCONTROLLED_PORT_Q ; } -#if defined (CONFIG_NET_SCHED ) && (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,28 )) -/* Remove the ethernet header */ -skb_pull (skb,ETH_HLEN ); - result =tx_handler (priv, skb, &ehdr, priority); -#else /* Uncontrolled port rules apply */ port_action =verify_port (priv , (((CSR_WIFI_ROUTER_CTRL_MODE_STA == interfacePriv->interfaceMode)||(CSR_WIFI_ROUTER_CTRL_MODE_P2PCLI== interfacePriv->interfaceMode))? interfacePriv->bssid.a: ehdr.h_dest)
@@ -1970,7 +1884,6 @@ uf_net_xmit(struct sk_buff *skb, struct net_device *dev)func_exit ();return NETDEV_TX_OK ; } -#endif /* CONFIG_NET_SCHED */ if (result ==NETDEV_TX_OK ) {#if (defined(CSR_WIFI_SECURITY_WAPI_ENABLE ) && defined(CSR_WIFI_SECURITY_WAPI_SW_ENCRYPTION ))
@@ -2043,7 +1956,6 @@ unifi_pause_xmit(void *ospriv, unifi_TrafficQueue queue)func_enter ();unifi_trace (priv,UDBG2 ,"Stopping queue %d\n" , queue); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 )for (i=0 ;i<CSR_WIFI_NUM_INTERFACES ;i++) {if (netif_running (priv->netdev[i]))
@@ -2051,24 +1963,6 @@ unifi_pause_xmit(void *ospriv, unifi_TrafficQueue queue)netif_stop_subqueue (priv->netdev[i], (u16 )queue); } } -#else -#ifdef ALLOW_Q_PAUSE -unifi_trace (priv,UDBG2 ,"Stopping netif\n" ); -/* stop the traffic from all the interfaces. */ -for (i=0 ;i<CSR_WIFI_NUM_INTERFACES ;i++) - { -if (netif_running (priv->netdev[i])) { -UF_NETIF_TX_STOP_ALL_QUEUES (priv->netdev[i]); - } - } -#else -if (net_is_tx_q_paused (priv, queue)) { -unifi_trace (priv,UDBG2 ,"Queue already stopped\n" ); -return ; - } -net_tx_q_pause (priv, queue); -#endif -#endif #ifdef CSR_SUPPORT_SME if (queue<=3 ) {
@@ -2092,7 +1986,6 @@ unifi_restart_xmit(void *ospriv, unifi_TrafficQueue queue)func_enter ();unifi_trace (priv,UDBG2 ,"Waking queue %d\n" , queue); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 )for (i=0 ;i<CSR_WIFI_NUM_INTERFACES ;i++) {if (netif_running (priv->netdev[i]))
@@ -2100,25 +1993,6 @@ unifi_restart_xmit(void *ospriv, unifi_TrafficQueue queue)netif_wake_subqueue (priv->netdev[i], (u16 )queue); } } -#else -#ifdef ALLOW_Q_PAUSE -/* Need to supply queue number depending on Kernel support */ -/* Resume the traffic from all the interfaces */ -for (i=0 ;i<CSR_WIFI_NUM_INTERFACES ;i++) - { -if (netif_running (priv->netdev[i])) { -UF_NETIF_TX_WAKE_ALL_QUEUES (priv->netdev[i]); - } - } -#else -if (!(net_is_tx_q_paused (priv, queue))) { -unifi_trace (priv,UDBG2 ,"Queue already running\n" ); -func_exit (); -return ; - } -net_tx_q_unpause (priv, queue); -#endif -#endif #ifdef CSR_SUPPORT_SME if (queue <=3 ) {
@@ -2333,11 +2207,7 @@ uf_resume_data_plane(unifi_priv_t *priv, int queue, {#ifdef CONFIG_NET_SCHED if (netif_running (priv->netdev[interfaceTag])) { -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,28 )netif_tx_schedule_all (priv->netdev[interfaceTag]); -#else -netif_schedule (priv->netdev[interfaceTag]); -#endif /* LINUX_VERSION_CODE */ }#endif uf_process_rx_pending_queue (priv, queue, peer_address,1 ,interfaceTag);
@@ -3163,330 +3033,6 @@ void uf_net_get_name(struct net_device *dev, char *name, int len) }/* uf_net_get_name */ - - - - -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,28 ) -#ifdef CONFIG_NET_SCHED - -/* -* --------------------------------------------------------------------------- -* uf_install_qdisc -* -* Creates a root qdisc, registers our qdisc handlers and -* overrides the device's qdisc_sleeping to prevent the system -* from creating a new one for our network device. -* -* Arguments: -* dev Pointer to the network device. -* -* Returns: -* 0 on success, Linux error code otherwise. -* -* Notes: -* This function holds the qdisk lock so it needs to be called -* after registering the network device in uf_register_netdev(). -* Also, the qdisc_create_dflt() API has changed in 2.6.20 to -* include the parentid. -* --------------------------------------------------------------------------- -*/ -int uf_install_qdisc (struct net_device *dev) -{ -struct Qdisc *qdisc; -struct netdev_queue *queue0; - - -func_enter (); - - qdisc =UF_QDISC_CREATE_DFLT (dev, &uf_qdisc_ops,TC_H_ROOT ); -if (!qdisc) { -unifi_error (NULL ,"%s: qdisc installation failed\n" , dev->name); -func_exit_r (-EFAULT ); -return -EFAULT ; - } -unifi_trace (NULL ,UDBG5 ,"%s: parent qdisc=0x%p\n" , - dev->name, qdisc); - - qdisc->handle =0x80020000 ; - qdisc->flags =0x0 ; - - queue0 =netdev_get_tx_queue (dev,0 ); -if (queue0 ==NULL ) { -unifi_error (NULL ,"%s: netdev_get_tx_queue returned no queue\n" , - dev->name); -func_exit_r (-EFAULT ); -return -EFAULT ; - } - queue0->qdisc = qdisc; - queue0->qdisc_sleeping = qdisc; - -func_exit_r (0 ); -return 0 ; - -}/* uf_install_qdisc() */ - -static int uf_qdiscop_enqueue (struct sk_buff *skb,struct Qdisc * qd) -{ -netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (qd->dev_queue->dev); -unifi_priv_t *priv = interfacePriv->privPtr; -struct uf_sched_data *q =qdisc_priv (qd); -struct uf_tx_packet_data *pkt_data = (struct uf_tx_packet_data *) skb->cb; -struct ethhdr ehdr; -struct Qdisc *qdisc; -int r, proto; - -func_enter (); - -memcpy (&ehdr, skb->data,ETH_HLEN ); - proto =ntohs (ehdr.h_proto); - -/* 802.1x - apply controlled/uncontrolled port rules */ -if ((proto !=ETH_P_PAE ) -#ifdef CSR_WIFI_SECURITY_WAPI_ENABLE - && (proto !=ETH_P_WAI ) -#endif - ) { -/* queues 0 - 3 */ - pkt_data->priority =get_packet_priority (priv, skb, &ehdr, interfacePriv); - pkt_data->queue =unifi_frame_priority_to_queue (pkt_data->priority); - }else { - pkt_data->queue =UNIFI_TRAFFIC_Q_EAPOL ; - } - - qdisc = q->queues[pkt_data->queue]; - r = qdisc->enqueue (skb, qdisc); -if (r ==NET_XMIT_SUCCESS ) { - qd->q.qlen++; - qd->bstats.bytes += skb->len; - qd->bstats.packets++; -func_exit_r (NET_XMIT_SUCCESS ); -return NET_XMIT_SUCCESS ; - } - -unifi_error (priv,"uf_qdiscop_enqueue: dropped\n" ); - qd->qstats.drops++; - -func_exit_r (r); -return r; - -}/* uf_qdiscop_enqueue() */ - - -static int uf_qdiscop_requeue (struct sk_buff *skb,struct Qdisc * qd) -{ -netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (qd->dev_queue->dev); -unifi_priv_t *priv = interfacePriv->privPtr; -struct uf_sched_data *q =qdisc_priv (qd); -struct uf_tx_packet_data *pkt_data = (struct uf_tx_packet_data *) skb->cb; -struct Qdisc *qdisc; -int r; - -func_enter (); - -unifi_trace (priv,UDBG5 ,"uf_qdiscop_requeue: (q=%d), tag=%u\n" , - pkt_data->queue, pkt_data->host_tag); - -/* we recorded which queue to use earlier! */ - qdisc = q->queues[pkt_data->queue]; - -if ((r = qdisc->ops->requeue (skb, qdisc)) ==0 ) { - qd->q.qlen++; -func_exit_r (0 ); -return 0 ; - } - -unifi_error (priv,"uf_qdiscop_requeue: dropped\n" ); - qd->qstats.drops++; - -func_exit_r (r); -return r; -}/* uf_qdiscop_requeue() */ - -static struct sk_buff *uf_qdiscop_dequeue (struct Qdisc * qd) -{ -netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (qd->dev_queue->dev); -unifi_priv_t *priv = interfacePriv->privPtr; -struct uf_sched_data *q =qdisc_priv (qd); -struct sk_buff *skb; -struct Qdisc *qdisc; -int queue, i; -struct ethhdr ehdr; -struct uf_tx_packet_data *pkt_data; -CsrWifiRouterCtrlPortAction port_action; - -func_enter (); - -/* check all the queues */ -for (i =UNIFI_TRAFFIC_Q_MAX -1 ; i >=0 ; i--) { - -if (i !=UNIFI_TRAFFIC_Q_EAPOL ) { - queue = priv->prev_queue; -if (++priv->prev_queue >=UNIFI_TRAFFIC_Q_EAPOL ) { - priv->prev_queue =0 ; - } - }else { - queue = i; - } - -#ifndef ALLOW_Q_PAUSE -/* If queue is paused, do not dequeue */ -if (net_is_tx_q_paused (priv, queue)) { -unifi_trace (priv,UDBG5 , -"uf_qdiscop_dequeue: tx queue paused (q=%d)\n" , queue); -continue ; - } -#endif - - qdisc = q->queues[queue]; - skb = qdisc->dequeue (qdisc); -if (skb) { -/* A packet has been dequeued, decrease the queued packets count */ - qd->q.qlen--; - - pkt_data = (struct uf_tx_packet_data *) skb->cb; - -/* Check the (un)controlled port status */ -memcpy (&ehdr, skb->data,ETH_HLEN ); - - port_action =verify_port (priv - , (((CSR_WIFI_ROUTER_CTRL_MODE_STA == interfacePriv->interfaceMode) ||(CSR_WIFI_ROUTER_CTRL_MODE_P2PCLI == interfacePriv->interfaceMode))? interfacePriv->bssid.a: ehdr.h_dest) - , (UNIFI_TRAFFIC_Q_EAPOL == queue?UF_UNCONTROLLED_PORT_Q :UF_CONTROLLED_PORT_Q ) - , interfacePriv->InterfaceTag); - -/* Dequeue packet if port is open */ -if (port_action ==CSR_WIFI_ROUTER_CTRL_PORT_ACTION_8021X_PORT_OPEN ) { -unifi_trace (priv,UDBG5 , -"uf_qdiscop_dequeue: new (q=%d), tag=%u\n" , - queue, pkt_data->host_tag); - -func_exit (); -return skb; - } - -/* Discard or block the packet if necessary */ -if (port_action ==CSR_WIFI_ROUTER_CTRL_PORT_ACTION_8021X_PORT_CLOSED_DISCARD ) { -unifi_trace (priv,UDBG5 , -"uf_qdiscop_dequeue: drop (q=%d), tag=%u\n" , - queue, pkt_data->host_tag); -kfree_skb (skb); -break ; - } - -/* We can not send the packet now, put it back to the queue */ -if (qdisc->ops->requeue (skb, qdisc) !=0 ) { -unifi_error (priv, -"uf_qdiscop_dequeue: requeue (q=%d) failed, tag=%u, drop it\n" , - queue, pkt_data->host_tag); - -/* Requeue failed, drop the packet */ -kfree_skb (skb); -break ; - } -/* We requeued the packet, increase the queued packets count */ - qd->q.qlen++; - -unifi_trace (priv,UDBG5 , -"uf_qdiscop_dequeue: skip (q=%d), tag=%u\n" , - queue, pkt_data->host_tag); - } - } - -func_exit (); -return NULL ; -}/* uf_qdiscop_dequeue() */ - - -static void uf_qdiscop_reset (struct Qdisc * qd) -{ -struct uf_sched_data *q =qdisc_priv (qd); -int queue; -func_enter (); - -for (queue =0 ; queue <UNIFI_TRAFFIC_Q_MAX ; queue++) { -qdisc_reset (q->queues[queue]); - } - qd->q.qlen =0 ; - -func_exit (); -}/* uf_qdiscop_reset() */ - - -static void uf_qdiscop_destroy (struct Qdisc * qd) -{ -struct uf_sched_data *q =qdisc_priv (qd); -int queue; - -func_enter (); - -for (queue=0 ; queue <UNIFI_TRAFFIC_Q_MAX ; queue++) { -qdisc_destroy (q->queues[queue]); - q->queues[queue] = &noop_qdisc; - } - -func_exit (); -}/* uf_qdiscop_destroy() */ - - -/* called whenever parameters are updated on existing qdisc */ -static int uf_qdiscop_tune (struct Qdisc *qd,struct nlattr *opt) -{ -func_enter (); -func_exit (); -return 0 ; -}/* uf_qdiscop_tune() */ - - -/* called during initial creation of qdisc on device */ -static int uf_qdiscop_init (struct Qdisc *qd,struct nlattr *opt) -{ -struct net_device *dev = qd->dev_queue->dev; -netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (dev); -unifi_priv_t *priv = interfacePriv->privPtr; -struct uf_sched_data *q =qdisc_priv (qd); -int err =0 , i; - -func_enter (); - -/* make sure we do not mess with the ingress qdisc */ -if (qd->flags &TCQ_F_INGRESS ) { -func_exit (); -return -EINVAL ; - } - -/* if options were passed in, set them */ -if (opt) { - err =uf_qdiscop_tune (qd, opt); - } - -/* create child queues */ -for (i =0 ; i <UNIFI_TRAFFIC_Q_MAX ; i++) { - q->queues[i] =UF_QDISC_CREATE_DFLT (dev, &pfifo_qdisc_ops, - qd->handle); -if (!q->queues[i]) { - q->queues[i] = &noop_qdisc; -unifi_error (priv,"%s child qdisc %i creation failed\n" ); - } - -unifi_trace (priv,UDBG5 ,"%s: child qdisc=0x%p\n" , - dev->name, q->queues[i]); - } - -func_exit_r (err); -return err; -}/* uf_qdiscop_init() */ - - -static int uf_qdiscop_dump (struct Qdisc *qd,struct sk_buff *skb) -{ -func_enter (); -func_exit_r (skb->len); -return skb->len; -}/* uf_qdiscop_dump() */ - -#endif /* CONFIG_NET_SCHED */ -#endif /* LINUX_VERSION_CODE */ -#ifdef CSR_SUPPORT_WEXT /*
Signature · 1 line
1.7.12
PATCH 4/14 staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.29
In reply to Priit Laes--- drivers/staging/csr/netdev.c | 27 --------------------------- 1 file changed, 27 deletions(-)
drivers/staging/csr/netdev.c +0 -27
@@ -163,7 +163,6 @@ struct uf_tx_packet_data {#endif /* CONFIG_NET_SCHED */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,29 )static const struct net_device_ops uf_netdev_ops = { .ndo_open = uf_net_open,
@@ -174,7 +173,6 @@ static const struct net_device_ops uf_netdev_ops = .ndo_set_rx_mode = uf_set_multicast_list, .ndo_select_queue = uf_net_select_queue, }; -#endif static u8 oui_rfc1042[P80211_OUI_LEN ] = {0x00 ,0x00 ,0x00 };static u8 oui_8021h[P80211_OUI_LEN ] = {0x00 ,0x00 ,0xf8 };
@@ -258,20 +256,7 @@ uf_alloc_netdevice(CsrSdioFunction *sdio_dev, int bus_id) priv->interfacePriv[0 ] = interfacePriv;/* Setup / override net_device fields */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,29 ) dev->netdev_ops = &uf_netdev_ops; -#else - dev->open = uf_net_open; - dev->stop = uf_net_stop; - dev->hard_start_xmit = uf_net_xmit; - dev->do_ioctl = uf_net_ioctl; - -/* called by /proc/net/dev */ - dev->get_stats = uf_net_get_stats; - - dev->set_multicast_list = uf_set_multicast_list; - dev->select_queue = uf_net_select_queue; -#endif #ifdef CSR_SUPPORT_WEXT dev->wireless_handlers = &unifi_iw_handler_def;
@@ -505,19 +490,7 @@ uf_alloc_netdevice_for_other_interfaces(unifi_priv_t *priv, u16 interfaceTag)INIT_LIST_HEAD (&interfacePriv->rx_controlled_list);/* Setup / override net_device fields */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,29 ) dev->netdev_ops = &uf_netdev_ops; -#else - dev->open = uf_net_open; - dev->stop = uf_net_stop; - dev->hard_start_xmit = uf_net_xmit; - dev->do_ioctl = uf_net_ioctl; - -/* called by /proc/net/dev */ - dev->get_stats = uf_net_get_stats; - - dev->set_multicast_list = uf_set_multicast_list; -#endif #ifdef CSR_SUPPORT_WEXT dev->wireless_handlers = &unifi_iw_handler_def;
Signature · 1 line
1.7.12
PATCH 5/14 staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.32
In reply to Priit Laes--- drivers/staging/csr/netdev.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/staging/csr/netdev.c +0 -14
@@ -101,17 +101,7 @@ static int uf_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);static int uf_net_stop (struct net_device *dev);static struct net_device_stats *uf_net_get_stats (struct net_device *dev);static u16 uf_net_select_queue (struct net_device *dev,struct sk_buff *skb); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )static netdev_tx_t uf_net_xmit (struct sk_buff *skb,struct net_device *dev); -#else -static int uf_net_xmit (struct sk_buff *skb,struct net_device *dev); -#ifndef NETDEV_TX_OK -#define NETDEV_TX_OK 0 -#endif -#ifndef NETDEV_TX_BUSY -#define NETDEV_TX_BUSY 1 -#endif -#endif static void uf_set_multicast_list (struct net_device *dev);
@@ -1793,11 +1783,7 @@ send_ma_pkt_request(unifi_priv_t *priv, struct sk_buff *skb, const struct ethhdr* The controlled port is handled in the qdisc dequeue handler. * --------------------------------------------------------------------------- */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )static netdev_tx_t -#else -static int -#endifuf_net_xmit (struct sk_buff *skb,struct net_device *dev) {netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv (dev);
Signature · 1 line
1.7.12
PATCH 6/14 staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.34
In reply to Priit Laes--- drivers/staging/csr/netdev.c | 25 ------------------------- 1 file changed, 25 deletions(-)
drivers/staging/csr/netdev.c +0 -25
@@ -2809,19 +2809,13 @@ uf_set_multicast_list(struct net_device *dev)#else u8 *mc_list = interfacePriv->mc_list; -#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,34 )struct netdev_hw_addr *mc_addr;int mc_addr_count; -#else -struct dev_mc_list *p;/* Pointer to the addresses structure. */ -int i; -#endif if (priv->init_progress !=UNIFI_INIT_COMPLETED ) {return ; } -#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,34 ) mc_addr_count =netdev_mc_count (dev); unifi_trace(priv, UDBG3,
@@ -2840,25 +2834,6 @@ uf_set_multicast_list(struct net_device *dev) mc_list += ETH_ALEN; } -#else -unifi_trace (priv,UDBG3 , -"uf_set_multicast_list (count=%d)\n" , dev->mc_count); - -/* Not enough space? */ -if (dev->mc_count >UNIFI_MAX_MULTICAST_ADDRESSES ) { -return ; - } - -/* Store the list to be processed by the work item. */ - interfacePriv->mc_list_count = dev->mc_count; - p = dev->mc_list; -for (i =0 ; i < dev->mc_count; i++) { -memcpy (mc_list, p->dmi_addr,ETH_ALEN ); - p = p->next; - mc_list +=ETH_ALEN ; - } -#endif -/* Send a message to the workqueue */ queue_work (priv->unifi_workqueue, &priv->multicast_list_task);#endif
Signature · 1 line
1.7.12
PATCH 7/14 staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.37
In reply to Priit Laes--- drivers/staging/csr/netdev.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/staging/csr/netdev.c +0 -8
@@ -339,21 +339,13 @@ uf_alloc_netdevice(CsrSdioFunction *sdio_dev, int bus_id) interfacePriv->connected = UnifiConnectedUnknown;/* -1 unknown, 0 no, 1 yes */ #ifdef USE_DRIVER_LOCK -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,37 )sema_init (&priv->lock,1 ); -#else -init_MUTEX (&priv->lock); -#endif #endif /* USE_DRIVER_LOCK */ spin_lock_init (&priv->send_signal_lock);spin_lock_init (&priv->m4_lock); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,37 )sema_init (&priv->ba_mutex,1 ); -#else -init_MUTEX (&priv->ba_mutex); -#endif #if (defined(CSR_WIFI_SECURITY_WAPI_ENABLE ) && defined(CSR_WIFI_SECURITY_WAPI_SW_ENCRYPTION ))spin_lock_init (&priv->wapi_lock);
Signature · 1 line
1.7.12
PATCH 8/14 staging: csr: remove unused define ALLOW_Q_PAUSE
In reply to Priit Laes--- drivers/staging/csr/netdev.c | 11 ----------- drivers/staging/csr/unifi_priv.h | 8 -------- 2 files changed, 19 deletions(-)
drivers/staging/csr/netdev.c +0 -11
@@ -56,17 +56,6 @@#include <net/pkt_sched.h> -/* ALLOW_Q_PAUSE: Pre 2.6.28 kernels do not support multiple driver queues (required for QoS). -* In order to support QoS in these kernels, multiple queues are implemented in the driver. But since -* there is only a single queue in the kernel (leading to multiple queues in the driver) there is no possibility -* of stopping a particular queue in the kernel. Stopping the single kernel queue leads to undesirable starvation -* of driver queues. One of the proposals is to not stop the kernel queue but to prevent dequeuing from the -* 'stopped' driver queue. Allow q pause is an experimental implementation of this scheme for pre 2.6.28 kernels. -* When NOT defined, queues are paused locally in the driver and packets are dequeued for transmission only from the -* unpaused queues. When Allow q pause is defined the kernel queue is stopped whenever any driver queue is paused. -*/ -#define ALLOW_Q_PAUSE -#ifdef UNIFI_NET_NAME #define UF_ALLOC_NETDEV (_dev, _size, _name, _setup, _num_of_queues) \ do { \
drivers/staging/csr/unifi_priv.h +0 -8
@@ -634,12 +634,10 @@ struct unifi_priv {spinlock_t wapi_lock;#endif -#ifndef ALLOW_Q_PAUSE /* Array to indicate if a particular Tx queue is paused, this may not be * required in a multiqueue implementation since we can directly stop kernel * queues */ u8 tx_q_paused_flag[UNIFI_TRAFFIC_Q_MAX ]; -#endif #ifdef CSR_WIFI_RX_PATH_SPLIT struct workqueue_struct *rx_workqueue;
@@ -798,12 +796,6 @@ typedef struct netInterface_privu8 bcTimSetReqQueued; } netInterface_priv_t; -#ifndef ALLOW_Q_PAUSE -#define net_is_tx_q_paused (priv, q) (priv->tx_q_paused_flag[q]) -#define net_tx_q_unpause (priv, q) (priv->tx_q_paused_flag[q] = 0) -#define net_tx_q_pause (priv, q) (priv->tx_q_paused_flag[q] = 1) -#endif -#ifdef CSR_SUPPORT_SME #define routerStartBuffering (priv,queue) priv->routerBufferEnable[(queue)] = TRUE;#define routerStopBuffering (priv,queue) priv->routerBufferEnable[(queue)] = FALSE;
Signature · 1 line
1.7.12
PATCH 9/14 staging: csr: Drop unused UNIFI_NET_NAME configuration option
In reply to Priit Laes--- drivers/staging/csr/netdev.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-)
drivers/staging/csr/netdev.c +2 -17
@@ -56,21 +56,6 @@#include <net/pkt_sched.h> -#ifdef UNIFI_NET_NAME -#define UF_ALLOC_NETDEV (_dev, _size, _name, _setup, _num_of_queues) \ - do { \ - static char name[8]; \ - sprintf(name, "%s%s", UNIFI_NET_NAME, _name); \ - _dev = alloc_netdev_mq(_size, name, _setup, _num_of_queues); \ - } while (0); -#else -#define UF_ALLOC_NETDEV (_dev, _size, _name, _setup, _num_of_queues) \ - do { \ - _dev = alloc_etherdev_mq(_size, _num_of_queues); \ - } while (0); -#endif /* UNIFI_NET_NAME */ - -/* Wext handler is suported only if CSR_SUPPORT_WEXT is defined */ #ifdef CSR_SUPPORT_WEXT extern struct iw_handler_def unifi_iw_handler_def;
@@ -213,7 +198,7 @@ uf_alloc_netdevice(CsrSdioFunction *sdio_dev, int bus_id)* The RedHat 9 redhat-config-network tool doesn't recognise wlan* devices, * so use "eth*" (like other wireless extns drivers). */ -UF_ALLOC_NETDEV (dev,sizeof (unifi_priv_t)+sizeof (netInterface_priv_t),"%d" , ether_setup,UNIFI_TRAFFIC_Q_MAX ); + dev =alloc_etherdev_mq (sizeof (unifi_priv_t) +sizeof (netInterface_priv_t),UNIFI_TRAFFIC_Q_MAX );if (dev ==NULL ) {return NULL ;
@@ -438,7 +423,7 @@ uf_alloc_netdevice_for_other_interfaces(unifi_priv_t *priv, u16 interfaceTag)* The RedHat 9 redhat-config-network tool doesn't recognise wlan* devices, * so use "eth*" (like other wireless extns drivers). */ -UF_ALLOC_NETDEV (dev,sizeof (netInterface_priv_t),"%d" , ether_setup,1 ); + dev =alloc_etherdev_mq (sizeof (netInterface_priv_t),1 );if (dev ==NULL ) {return FALSE; }
Signature · 1 line
1.7.12
PATCH 10/14 staging: csr: drv.c: Remove KERNEL_VERSION checks and associated defines
In reply to Priit Laes--- drivers/staging/csr/drv.c | 43 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 35 deletions(-)
drivers/staging/csr/drv.c +8 -35
@@ -124,11 +124,7 @@ static void udi_set_log_filter(ul_client_t *pcli,/* Mutex to protect access to priv->sme_cli */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,37 )DEFINE_SEMAPHORE (udi_mutex); -#else -DECLARE_MUTEX (udi_mutex); -#endif s32 CsrHipResultToStatus (CsrResult csrResult) {
@@ -1980,18 +1976,6 @@ uf_sme_queue_message(unifi_priv_t *priv, u8 *buffer, int length) } /* uf_sme_queue_message() */#endif - -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 ) -#define UF_DEVICE_CREATE (_class, _parent, _devno, _priv, _fmt, _args) \ - device_create(_class, _parent, _devno, _priv, _fmt, _args) -#elif LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,26 ) -#define UF_DEVICE_CREATE (_class, _parent, _devno, _priv, _fmt, _args) \ - device_create_drvdata(_class, _parent, _devno, _priv, _fmt, _args) -#else -#define UF_DEVICE_CREATE (_class, _parent, _devno, _priv, _fmt, _args) \ - device_create(_class, _parent, _devno, _fmt, _args) -#endif -/* **************************************************************************** *
@@ -2009,17 +1993,6 @@ static struct file_operations unifi_fops = { .poll = unifi_poll, }; -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 ) -#define UF_DEVICE_CREATE (_class, _parent, _devno, _priv, _fmt, _args) \ - device_create(_class, _parent, _devno, _priv, _fmt, _args) -#elif LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,26 ) -#define UF_DEVICE_CREATE (_class, _parent, _devno, _priv, _fmt, _args) \ - device_create_drvdata(_class, _parent, _devno, _priv, _fmt, _args) -#else -#define UF_DEVICE_CREATE (_class, _parent, _devno, _priv, _fmt, _args) \ - device_create(_class, _parent, _devno, _fmt, _args) -#endif -static dev_t unifi_first_devno;static struct class *unifi_class;
@@ -2042,11 +2015,11 @@ int uf_create_device_nodes(unifi_priv_t *priv, int bus_id) }#ifdef SDIO_EXPORTS_STRUCT_DEVICE -if (!UF_DEVICE_CREATE (unifi_class, priv->unifi_device, - devno, priv,"unifi%d" , bus_id)) { +if (!device_create (unifi_class, priv->unifi_device, + devno, priv,"unifi%d" , bus_id)) {#else - priv->unifi_device =UF_DEVICE_CREATE (unifi_class,NULL , - devno, priv,"unifi%d" , bus_id); + priv->unifi_device =device_create (unifi_class,NULL , + devno, priv,"unifi%d" , bus_id);if (priv->unifi_device ==NULL ) {#endif /* SDIO_EXPORTS_STRUCT_DEVICE */
@@ -2068,13 +2041,13 @@ int uf_create_device_nodes(unifi_priv_t *priv, int bus_id)return r; } -if (!UF_DEVICE_CREATE (unifi_class, +if (!device_create (unifi_class, #ifdef SDIO_EXPORTS_STRUCT_DEVICE - priv->unifi_device, + priv->unifi_device, #else -NULL , +NULL , #endif /* SDIO_EXPORTS_STRUCT_DEVICE */ - devno, priv,"unifiudi%d" , bus_id)) { + devno, priv,"unifiudi%d" , bus_id)) {device_destroy (unifi_class, priv->unifi_cdev.dev);cdev_del (&priv->unifiudi_cdev);cdev_del (&priv->unifi_cdev);
Signature · 1 line
1.7.12
PATCH 11/14 staging: csr: unifi_wext.h: Remove KERNEL_VERSION checks
In reply to Priit Laes--- drivers/staging/csr/unifi_wext.h | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-)
drivers/staging/csr/unifi_wext.h +5 -21
@@ -70,15 +70,9 @@ uf_iwe_stream_add_point(struct iw_request_info *info, char *start, char *stop, {char *new_start; - new_start =iwe_stream_add_point ( -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) || defined (IW_REQUEST_FLAG_COMPAT) - info, -#endif - start, stop, piwe, extra); + new_start =iwe_stream_add_point (info, start, stop, piwe, extra);if (unlikely (new_start == start)) - {return -E2BIG ; - }return (new_start - start); }
@@ -90,14 +84,9 @@ uf_iwe_stream_add_event(struct iw_request_info *info, char *start, char *stop, {char *new_start; - new_start =iwe_stream_add_event ( -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) || defined(IW_REQUEST_FLAG_COMPAT) - info, -#endif - start, stop, piwe, len); -if (unlikely (new_start == start)) { + new_start =iwe_stream_add_event (info, start, stop, piwe, len); +if (unlikely (new_start == start))return -E2BIG ; - }return (new_start - start); }
@@ -108,14 +97,9 @@ uf_iwe_stream_add_value(struct iw_request_info *info, char *stream, char *start, {char *new_start; - new_start =iwe_stream_add_value ( -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) || defined(IW_REQUEST_FLAG_COMPAT) - info, -#endif - stream, start, stop, piwe, len); -if (unlikely (new_start == start)) { + new_start =iwe_stream_add_value (info, stream, start, stop, piwe, len); +if (unlikely (new_start == start))return -E2BIG ; - }return (new_start - start); }
Signature · 1 line
1.7.12
PATCH 12/14 staging: csr: unifi_priv.h: Remove KERNEL_VERSION checks
In reply to Priit Laes--- drivers/staging/csr/unifi_priv.h | 27 --------------------------- 1 file changed, 27 deletions(-)
drivers/staging/csr/unifi_priv.h +0 -27
@@ -29,9 +29,7 @@#include <linux/wireless.h> #include <linux/cdev.h> #include <linux/kthread.h> -#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,19 )#include <linux/freezer.h> -#endif #ifdef CSR_WIFI_SUPPORT_MMC_DRIVER #include <linux/mmc/core.h>
@@ -73,31 +71,9 @@ extern struct wake_lock unifi_sdio_wake_lock;#include "unifi_clients.h" - -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,20 ) -#include <linux/workqueue.h> - -#undef INIT_WORK -#define INIT_WORK (_work, _func) \ - do { \ - INIT_LIST_HEAD(&(_work)->entry); \ - (_work)->pending = 0; \ - PREPARE_WORK((_work), (_func), (_work)); \ - init_timer(&(_work)->timer); \ - } while(0) - -#endif /* Linux kernel < 2.6.20 */ - - -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,27 )#define UF_NETIF_TX_WAKE_ALL_QUEUES (_netdev) netif_tx_wake_all_queues(_netdev)#define UF_NETIF_TX_START_ALL_QUEUES (_netdev) netif_tx_start_all_queues(_netdev)#define UF_NETIF_TX_STOP_ALL_QUEUES (_netdev) netif_tx_stop_all_queues(_netdev) -#else -#define UF_NETIF_TX_WAKE_ALL_QUEUES (_netdev) netif_wake_queue(_netdev) -#define UF_NETIF_TX_START_ALL_QUEUES (_netdev) netif_start_queue(_netdev) -#define UF_NETIF_TX_STOP_ALL_QUEUES (_netdev) netif_stop_queue(_netdev) -#endif /* Linux kernel >= 2.6.27 */ #ifdef CSR_NATIVE_LINUX
@@ -1080,9 +1056,6 @@ CsrWifiRouterCtrlStaInfo_t * CsrWifiRouterCtrlGetStationRecordFromHandle(unifi_pvoid uf_update_sta_activity (unifi_priv_t *priv,u16 interfaceTag,const u8 *peerMacAddress);void uf_process_ma_pkt_cfm_for_ap (unifi_priv_t *priv,u16 interfaceTag,const CSR_MA_PACKET_CONFIRM *pkt_cfm);#endif -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,28 ) -int uf_install_qdisc (struct net_device *dev); -#endif void uf_resume_data_plane(unifi_priv_t *priv, int queue, CsrWifiMacAddress peer_address,
Signature · 1 line
1.7.12
PATCH 13/14 staging: csr: Remove unneeded UF_NETIF_TX_* macros
In reply to Priit Laes--- drivers/staging/csr/io.c | 2 +- drivers/staging/csr/netdev.c | 6 +++--- drivers/staging/csr/sdio_events.c | 4 ++-- drivers/staging/csr/sme_sys.c | 6 +++--- drivers/staging/csr/unifi_priv.h | 5 ----- 5 files changed, 9 insertions(+), 14 deletions(-)
drivers/staging/csr/io.c +1 -1
@@ -669,7 +669,7 @@ unregister_unifi_sdio(int bus_id)if (interfacePriv->netdev_registered) {netif_carrier_off (priv->netdev[interfaceTag]); -UF_NETIF_TX_STOP_ALL_QUEUES (priv->netdev[interfaceTag]); +netif_tx_stop_all_queues (priv->netdev[interfaceTag]); } }
drivers/staging/csr/netdev.c +3 -3
@@ -614,7 +614,7 @@ uf_net_open(struct net_device *dev) }#endif -UF_NETIF_TX_START_ALL_QUEUES (dev); +netif_tx_start_all_queues (dev);func_exit ();return 0 ;
@@ -644,7 +644,7 @@ uf_net_stop(struct net_device *dev)func_enter ();#endif -UF_NETIF_TX_STOP_ALL_QUEUES (dev); +netif_tx_stop_all_queues (dev);func_exit ();return 0 ;
@@ -2978,7 +2978,7 @@ uf_netdev_event(struct notifier_block *notif, unsigned long event, void* ptr) { interfacePriv->wait_netdev_change ? "" : "not");if (interfacePriv->wait_netdev_change) { -UF_NETIF_TX_WAKE_ALL_QUEUES (priv->netdev[interfacePriv->InterfaceTag]); +netif_tx_wake_all_queues (priv->netdev[interfacePriv->InterfaceTag]); interfacePriv->connected = UnifiConnected; interfacePriv->wait_netdev_change = FALSE;/* Note: passing the broadcast address here will allow anyone to attempt to join our adhoc network */
drivers/staging/csr/sdio_events.c +2 -2
@@ -66,7 +66,7 @@ void unifi_suspend(void *ospriv)unifi_trace (priv,UDBG1 ,"unifi_suspend: netif_carrier_off" );netif_carrier_off (priv->netdev[interfaceTag]); } -UF_NETIF_TX_STOP_ALL_QUEUES (priv->netdev[interfaceTag]); +netif_tx_stop_all_queues (priv->netdev[interfaceTag]); } }
@@ -119,7 +119,7 @@ void unifi_resume(void *ospriv)if (interfacePriv->netdev_registered ==1 ) {netif_carrier_on (priv->netdev[interfaceTag]); -UF_NETIF_TX_START_ALL_QUEUES (priv->netdev[interfaceTag]); +netif_tx_start_all_queues (priv->netdev[interfaceTag]); } }
drivers/staging/csr/sme_sys.c +3 -3
@@ -192,7 +192,7 @@ void CsrWifiRouterCtrlMediaStatusReqHandler(void* drvpriv, CsrWifiFsmEvent* msg)#endif unifi_trace (priv,UDBG1 ,"CsrWifiRouterCtrlMediaStatusReqHandler: AP/P2PGO setting netif_carrier_on\n" ); -UF_NETIF_TX_WAKE_ALL_QUEUES (priv->netdev[req->interfaceTag]); +netif_tx_wake_all_queues (priv->netdev[req->interfaceTag]);break ;default :
@@ -226,7 +226,7 @@ void CsrWifiRouterCtrlMediaStatusReqHandler(void* drvpriv, CsrWifiFsmEvent* msg)unifi_trace (priv,UDBG1 ,"CsrWifiRouterMediaStatusReqHandler: UnifiConnected && netif_carrier_on\n" );netif_carrier_on (priv->netdev[req->interfaceTag]); -UF_NETIF_TX_WAKE_ALL_QUEUES (priv->netdev[req->interfaceTag]); +netif_tx_wake_all_queues (priv->netdev[req->interfaceTag]);uf_process_rx_pending_queue (priv,UF_UNCONTROLLED_PORT_Q , broadcast_address,1 , interfacePriv->InterfaceTag);uf_process_rx_pending_queue (priv,UF_CONTROLLED_PORT_Q , broadcast_address,1 , interfacePriv->InterfaceTag); }
@@ -955,7 +955,7 @@ void CsrWifiRouterCtrlWifiOffReqHandler(void* drvpriv, CsrWifiFsmEvent* msg)netInterface_priv_t *interfacePriv = priv->interfacePriv[i];if (interfacePriv->netdev_registered ==1 ) {netif_carrier_off (priv->netdev[i]); -UF_NETIF_TX_STOP_ALL_QUEUES (priv->netdev[i]); +netif_tx_stop_all_queues (priv->netdev[i]); interfacePriv->connected = UnifiConnectedUnknown; } interfacePriv->interfaceMode =0 ;
drivers/staging/csr/unifi_priv.h +0 -5
@@ -71,11 +71,6 @@ extern struct wake_lock unifi_sdio_wake_lock;#include "unifi_clients.h" -#define UF_NETIF_TX_WAKE_ALL_QUEUES (_netdev) netif_tx_wake_all_queues(_netdev) -#define UF_NETIF_TX_START_ALL_QUEUES (_netdev) netif_tx_start_all_queues(_netdev) -#define UF_NETIF_TX_STOP_ALL_QUEUES (_netdev) netif_tx_stop_all_queues(_netdev) - -#ifdef CSR_NATIVE_LINUX #include "sme_native/unifi_native.h" #else
Signature · 1 line
1.7.12
PATCH 14/14 staging: csr: Remove all leftover kernel version checks \o/
In reply to Priit Laes--- drivers/staging/csr/csr_framework_ext.c | 13 +------------ drivers/staging/csr/csr_time.c | 7 ------- drivers/staging/csr/io.c | 19 ------------------- drivers/staging/csr/monitor.c | 4 ---- drivers/staging/csr/sdio_mmc.c | 20 -------------------- drivers/staging/csr/sme_native.c | 4 ---- drivers/staging/csr/sme_sys.c | 2 -- drivers/staging/csr/ul_int.c | 4 ---- drivers/staging/csr/unifi_pdu_processing.c | 3 --- 9 files changed, 1 insertion(+), 75 deletions(-)
drivers/staging/csr/csr_framework_ext.c +1 -12
@@ -12,20 +12,9 @@#include <linux/version.h> #include <linux/kthread.h> #include <linux/module.h> - -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,34 ) -#include <linux/slab.h> -#endif - -#if LINUX_VERSION_CODE >KERNEL_VERSION (2 ,6 ,19 )#include <linux/freezer.h> -#endif -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,27 ) -#include <asm/semaphore.h> -#else #include <linux/semaphore.h> -#endif - +#include <linux/slab.h> #include <linux/bitops.h> #include "csr_framework_ext.h"
drivers/staging/csr/csr_time.c +0 -7
@@ -10,13 +10,6 @@#include <linux/kernel.h> #include <linux/version.h> - -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,33 ) -#elif LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,16 ) -#include <linux/autoconf.h> -#include <linux/config.h> -#endif -#include <linux/time.h> #include <linux/module.h>
drivers/staging/csr/io.c +0 -19
@@ -70,11 +70,7 @@ static int In_use[MAX_UNIFI_DEVS];* Mutex to prevent UDI clients to open the character device before the priv * is created and initialised. */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,37 )DEFINE_SEMAPHORE (Unifi_instance_mutex); -#else -DECLARE_MUTEX (Unifi_instance_mutex); -#endif /* * When the device is removed, unregister waits on Unifi_cleanup_wq * until all the UDI clients release the character device.
@@ -177,21 +173,6 @@ uf_register_netdev(unifi_priv_t *priv, int interfaceTag)/* The device is registed */ interfacePriv->netdev_registered =1 ; -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,28 ) -#ifdef CONFIG_NET_SCHED -/* -* IMPORTANT: -* uf_install_qdisc() holds the network device lock, we can not -* install the qdisk before the network device is registered. -*/ - r =uf_install_qdisc (priv->netdev[interfaceTag]); -if (r) { -unifi_error (priv,"Failed to install qdisc\n" ); -return r; - } -#endif /* CONFIG_NET_SCHED */ -#endif /* LINUX_VERSION_CODE */ -#ifdef CSR_SUPPORT_SME /* * Register the inet handler; it notifies us for changes in the IP address.
drivers/staging/csr/monitor.c +0 -4
@@ -192,11 +192,7 @@ netrx_radiotap(unifi_priv_t *priv, skb->dev = dev; -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,22 ) skb->mac_header = skb->data; -#else - skb->mac.raw = skb->data; -#endif skb->pkt_type =PACKET_OTHERHOST ; skb->protocol =__constant_htons (ETH_P_80211_RAW );memset (skb->cb,0 ,sizeof (skb->cb));
drivers/staging/csr/sdio_mmc.c +0 -20
@@ -31,7 +31,6 @@ struct wake_lock unifi_sdio_wake_lock; /* wakelock to prevent suspend while resustatic CsrSdioFunctionDriver *sdio_func_drv; -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )#ifdef CONFIG_PM static int uf_sdio_mmc_power_event (struct notifier_block *this,unsigned long event,void *ptr);#endif
@@ -45,7 +44,6 @@ static int uf_sdio_mmc_power_event(struct notifier_block *this, unsigned long ev* returning immediately (at least on x86). */ static int card_is_powered =1 ; -#endif /* 2.6.32 */ /* MMC uses ENOMEDIUM to indicate card gone away */
@@ -637,7 +635,6 @@ CsrSdioFunctionIdle(CsrSdioFunction *function)CsrResult CsrSdioPowerOn (CsrSdioFunction *function) { -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )struct sdio_func *func = (struct sdio_func *)function->priv;struct mmc_host *host = func->card->host;
@@ -649,7 +646,6 @@ CsrSdioPowerOn(CsrSdioFunction *function)printk (KERN_INFO "SDIO: Skip power on; card is already powered.\n" ); }_sdio_release_host (func); -#endif /* 2.6.32 */ return CSR_RESULT_SUCCESS ; }/* CsrSdioPowerOn() */
@@ -667,7 +663,6 @@ CsrSdioPowerOn(CsrSdioFunction *function)void CsrSdioPowerOff (CsrSdioFunction *function) { -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )struct sdio_func *func = (struct sdio_func *)function->priv;struct mmc_host *host = func->card->host;
@@ -679,7 +674,6 @@ CsrSdioPowerOff(CsrSdioFunction *function)printk (KERN_INFO "SDIO: Skip power off; card is already powered off.\n" ); }_sdio_release_host (func); -#endif /* 2.6.32 */ }/* CsrSdioPowerOff() */
@@ -897,7 +891,6 @@ csr_sdio_linux_install_irq(CsrSdioFunction *function)return r; }/* csr_sdio_linux_install_irq() */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )#ifdef CONFIG_PM /*
@@ -1023,7 +1016,6 @@ uf_sdio_mmc_power_event(struct notifier_block *this, unsigned long event, void * }#endif /* CONFIG_PM */ -#endif /* 2.6.32 */ /* * ---------------------------------------------------------------------------
@@ -1050,10 +1042,8 @@ uf_glue_sdio_probe(struct sdio_func *func,/* First of all claim the SDIO driver */ sdio_claim_host (func); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )/* Assume that the card is already powered */ card_is_powered =1 ; -#endif /* Assumes one card per host, which is true for SDIO */ instance = func->card->host->index;
@@ -1093,14 +1083,12 @@ uf_glue_sdio_probe(struct sdio_func *func,/* Pass context to the SDIO driver */ sdio_set_drvdata (func, sdio_ctx); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )#ifdef CONFIG_PM /* Register to get PM events */ if (uf_sdio_mmc_register_pm_notifier (sdio_ctx) ==NULL ) {unifi_error (NULL ,"%s: Failed to register for PM events\n" , __FUNCTION__); }#endif -#endif /* Register this device with the SDIO function driver */ /* Call the main UniFi driver inserted handler */
@@ -1156,12 +1144,10 @@ uf_glue_sdio_remove(struct sdio_func *func) sdio_func_drv->removed (sdio_ctx); } -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )#ifdef CONFIG_PM /* Unregister for PM events */ uf_sdio_mmc_unregister_pm_notifier (sdio_ctx);#endif -#endif kfree (sdio_ctx);
@@ -1182,7 +1168,6 @@ static const struct sdio_device_id unifi_ids[] = {MODULE_DEVICE_TABLE (sdio, unifi_ids); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )#ifdef CONFIG_PM /*
@@ -1252,16 +1237,13 @@ static struct dev_pm_ops unifi_pm_ops = {#define UNIFI_PM_OPS NULL#endif /* CONFIG_PM */ -#endif /* 2.6.32 */ static struct sdio_driver unifi_driver = { .probe = uf_glue_sdio_probe, .remove = uf_glue_sdio_remove, .name ="unifi" , .id_table = unifi_ids, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) .drv.pm =UNIFI_PM_OPS , -#endif /* 2.6.32 */ };
@@ -1305,12 +1287,10 @@ CsrSdioFunctionDriverRegister(CsrSdioFunctionDriver *sdio_drv)*/ sdio_func_drv = sdio_drv; -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,32 )#ifdef CONFIG_PM /* Initialise PM notifier list */ INIT_LIST_HEAD (&uf_sdio_mmc_pm_notifiers.list);#endif -#endif /* Register ourself with mmc_core */ r =sdio_register_driver (&unifi_driver);
drivers/staging/csr/sme_native.c +0 -4
@@ -24,11 +24,7 @@ uf_sme_init(unifi_priv_t *priv) {func_enter (); -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,37 )sema_init (&priv->mlme_blocking_mutex,1 ); -#else -init_MUTEX (&priv->mlme_blocking_mutex); -#endif #ifdef CSR_SUPPORT_WEXT {
drivers/staging/csr/sme_sys.c +0 -2
@@ -869,7 +869,6 @@ wifi_off(unifi_priv_t *priv)unifi_trace (priv,UDBG1 ,"wifi_off\n" );/* Destroy the Traffic Analysis Module */ -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,23 )cancel_work_sync (&priv->ta_ind_work.task);cancel_work_sync (&priv->ta_sample_ind_work.task);#ifdef CSR_SUPPORT_WEXT
@@ -884,7 +883,6 @@ wifi_off(unifi_priv_t *priv)cancel_work_sync (&netpriv->send_m4_ready_task); } } -#endif flush_workqueue (priv->unifi_workqueue);/* fw_init parameter can prevent power off UniFi, for debugging */
drivers/staging/csr/ul_int.c +0 -4
@@ -44,11 +44,7 @@ ul_init_clients(unifi_priv_t *priv)int id;ul_client_t *ul_clients; -#if LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,37 )sema_init (&priv->udi_logging_mutex,1 ); -#else -init_MUTEX (&priv->udi_logging_mutex); -#endif priv->logging_client =NULL ; ul_clients = priv->ul_clients;
drivers/staging/csr/unifi_pdu_processing.c +0 -3
@@ -23,9 +23,6 @@#include "csr_wifi_hip_conversions.h" #include "csr_time.h" #include "unifi_priv.h" -#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,13 ) -#include <net/iw_handler.h> -#endif #include <net/pkt_sched.h> #ifdef CSR_SUPPORT_SME
Signature · 1 line
1.7.12