#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)
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 */
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);
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",
}
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;
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;
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;
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;
/* 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);