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

Commit 58abe64f authored by Priit Laes's avatar Priit Laes Committed by Greg Kroah-Hartman
Browse files

staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.27

parent 0505c63d
Loading
Loading
Loading
Loading
+0 −42
Original line number Diff line number Diff line
@@ -215,9 +215,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)
@@ -2337,8 +2334,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 */
@@ -3198,25 +3193,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);
@@ -3229,7 +3210,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",
@@ -3239,12 +3219,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;
@@ -3253,11 +3227,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;
@@ -3304,11 +3274,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;
@@ -3338,11 +3304,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;
@@ -3477,11 +3439,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);