114 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
116 #include <linux/capability.h>
117 #include <linux/module.h>
118 #include <linux/kernel.h>
120 #include <linux/slab.h>
122 #include <linux/netdevice.h>
126 #include <linux/if_arp.h>
127 #include <linux/if_eql.h>
130 #include <asm/uaccess.h>
137 #define eql_is_slave(dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE)
138 #define eql_is_master(dev) ((dev->flags & IFF_MASTER) == IFF_MASTER)
142 static void eql_timer(
unsigned long param)
157 eql_kill_one_slave(&eql->
queue, slave);
171 .ndo_open = eql_open,
172 .ndo_stop = eql_close,
173 .ndo_do_ioctl = eql_ioctl,
174 .ndo_start_xmit = eql_slave_xmit,
184 eql->
timer.function = eql_timer;
211 "remember to turn off Van-Jacobson compression on your slave devices\n");
236 spin_lock_bh(&queue->
lock);
242 eql_kill_one_slave(queue, s);
245 spin_unlock_bh(&queue->
lock);
259 eql_kill_slave_queue(&eql->
queue);
281 return eql_enslave(dev, ifr->ifr_data);
283 return eql_emancipate(dev, ifr->ifr_data);
285 return eql_g_slave_cfg(dev, ifr->ifr_data);
287 return eql_s_slave_cfg(dev, ifr->ifr_data);
289 return eql_g_master_cfg(dev, ifr->ifr_data);
291 return eql_s_master_cfg(dev, ifr->ifr_data);
300 unsigned long best_load = ~0
UL;
310 unsigned long slave_load, bytes_queued, priority_Bps;
318 slave_load = (~0
UL - (~0
UL / 2)) -
319 (priority_Bps) + bytes_queued * 8;
321 if (slave_load < best_load) {
322 best_load = slave_load;
327 eql_kill_one_slave(queue, slave);
340 slave = __eql_schedule_slaves(&eql->
queue);
344 skb->
dev = slave_dev;
348 dev->
stats.tx_packets++;
350 dev->
stats.tx_dropped++;
372 if (slave->
dev == dev)
391 if (!eql_is_full(queue)) {
394 duplicate_slave = __eql_find_slave_dev(queue, slave->
dev);
396 eql_kill_one_slave(queue, duplicate_slave);
438 ret = __eql_insert_slave(&eql->
queue, s);
474 eql_kill_one_slave(&eql->
queue, slave);
505 slave = __eql_find_slave_dev(&eql->
queue, slave_dev);
538 eql = netdev_priv(dev);
541 slave = __eql_find_slave_dev(&eql->
queue, slave_dev);
564 eql = netdev_priv(dev);
583 eql = netdev_priv(dev);
593 static int __init eql_init_module(
void)
609 static void __exit eql_cleanup_module(
void)