staging: csr: netdev.c: Clean up KERNEL_VERSION checks: 2.6.27
Signed-off-by: Priit Laes <plaes@plaes.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0505c63d3a
commit
58abe64fcf
1 changed files with 0 additions and 42 deletions
|
@ -215,9 +215,6 @@ static struct Qdisc_ops uf_qdisc_ops =
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
|
||||||
#define UF_QDISC_CREATE_DFLT(_dev, _ops, _root)
|
#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
|
#else
|
||||||
#define UF_QDISC_CREATE_DFLT(_dev, _ops, _root) \
|
#define UF_QDISC_CREATE_DFLT(_dev, _ops, _root) \
|
||||||
qdisc_create_dflt(dev, _ops)
|
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 (netif_running(priv->netdev[interfaceTag])) {
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
|
||||||
netif_tx_schedule_all(priv->netdev[interfaceTag]);
|
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
|
#else
|
||||||
netif_schedule(priv->netdev[interfaceTag]);
|
netif_schedule(priv->netdev[interfaceTag]);
|
||||||
#endif /* LINUX_VERSION_CODE */
|
#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)
|
int uf_install_qdisc(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct Qdisc *qdisc;
|
struct Qdisc *qdisc;
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
|
||||||
struct netdev_queue *queue0;
|
struct netdev_queue *queue0;
|
||||||
#endif /* LINUX_VERSION_CODE */
|
|
||||||
|
|
||||||
|
|
||||||
func_enter();
|
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);
|
qdisc = UF_QDISC_CREATE_DFLT(dev, &uf_qdisc_ops, TC_H_ROOT);
|
||||||
if (!qdisc) {
|
if (!qdisc) {
|
||||||
unifi_error(NULL, "%s: qdisc installation failed\n", dev->name);
|
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->handle = 0x80020000;
|
||||||
qdisc->flags = 0x0;
|
qdisc->flags = 0x0;
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
|
|
||||||
queue0 = netdev_get_tx_queue(dev, 0);
|
queue0 = netdev_get_tx_queue(dev, 0);
|
||||||
if (queue0 == NULL) {
|
if (queue0 == NULL) {
|
||||||
unifi_error(NULL, "%s: netdev_get_tx_queue returned no queue\n",
|
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 = qdisc;
|
||||||
queue0->qdisc_sleeping = 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);
|
func_exit_r(0);
|
||||||
return 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)
|
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);
|
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;
|
unifi_priv_t *priv = interfacePriv->privPtr;
|
||||||
struct uf_sched_data *q = qdisc_priv(qd);
|
struct uf_sched_data *q = qdisc_priv(qd);
|
||||||
struct uf_tx_packet_data *pkt_data = (struct uf_tx_packet_data *) skb->cb;
|
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)
|
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);
|
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;
|
unifi_priv_t *priv = interfacePriv->privPtr;
|
||||||
struct uf_sched_data *q = qdisc_priv(qd);
|
struct uf_sched_data *q = qdisc_priv(qd);
|
||||||
struct uf_tx_packet_data *pkt_data = (struct uf_tx_packet_data *) skb->cb;
|
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)
|
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);
|
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;
|
unifi_priv_t *priv = interfacePriv->privPtr;
|
||||||
struct uf_sched_data *q = qdisc_priv(qd);
|
struct uf_sched_data *q = qdisc_priv(qd);
|
||||||
struct sk_buff *skb;
|
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 */
|
/* called during initial creation of qdisc on device */
|
||||||
static int uf_qdiscop_init(struct Qdisc *qd, struct nlattr *opt)
|
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;
|
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);
|
netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv(dev);
|
||||||
unifi_priv_t *priv = interfacePriv->privPtr;
|
unifi_priv_t *priv = interfacePriv->privPtr;
|
||||||
struct uf_sched_data *q = qdisc_priv(qd);
|
struct uf_sched_data *q = qdisc_priv(qd);
|
||||||
|
|
Loading…
Add table
Reference in a new issue