Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sundance: SIOCDEVPRIVATE pollution

To quote one of my favorite contemporary author:
[include/linux/sockios.h]
* THESE IOCTLS ARE _DEPRECATED_ AND WILL DISAPPEAR IN 2.5.X -DaveM
*/

#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */

[...]

Gentoo's snmpd trips up over this code when trying to figure if the driver
supports the non-SIOCDEVPRIVATE API or not. One can argue over its choice
of heuristic but there no reason to make ioctl more ugly than needed.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Jesse Huang <jesse@icplus.com.tw>
Tested-by: Volker Sauer <vsauer@dvs.tu-darmstadt.de>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by

Francois Romieu and committed by
David S. Miller
3627947e 993fb90c

-26
-26
drivers/net/sundance.c
··· 1596 1596 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1597 1597 { 1598 1598 struct netdev_private *np = netdev_priv(dev); 1599 - void __iomem *ioaddr = np->base; 1600 1599 int rc; 1601 - int i; 1602 1600 1603 1601 if (!netif_running(dev)) 1604 1602 return -EINVAL; ··· 1604 1606 spin_lock_irq(&np->lock); 1605 1607 rc = generic_mii_ioctl(&np->mii_if, if_mii(rq), cmd, NULL); 1606 1608 spin_unlock_irq(&np->lock); 1607 - switch (cmd) { 1608 - case SIOCDEVPRIVATE: 1609 - for (i=0; i<TX_RING_SIZE; i++) { 1610 - printk(KERN_DEBUG "%02x %08llx %08x %08x(%02x) %08x %08x\n", i, 1611 - (unsigned long long)(np->tx_ring_dma + i*sizeof(*np->tx_ring)), 1612 - le32_to_cpu(np->tx_ring[i].next_desc), 1613 - le32_to_cpu(np->tx_ring[i].status), 1614 - (le32_to_cpu(np->tx_ring[i].status) >> 2) 1615 - & 0xff, 1616 - le32_to_cpu(np->tx_ring[i].frag[0].addr), 1617 - le32_to_cpu(np->tx_ring[i].frag[0].length)); 1618 - } 1619 - printk(KERN_DEBUG "TxListPtr=%08x netif_queue_stopped=%d\n", 1620 - ioread32(np->base + TxListPtr), 1621 - netif_queue_stopped(dev)); 1622 - printk(KERN_DEBUG "cur_tx=%d(%02x) dirty_tx=%d(%02x)\n", 1623 - np->cur_tx, np->cur_tx % TX_RING_SIZE, 1624 - np->dirty_tx, np->dirty_tx % TX_RING_SIZE); 1625 - printk(KERN_DEBUG "cur_rx=%d dirty_rx=%d\n", np->cur_rx, np->dirty_rx); 1626 - printk(KERN_DEBUG "cur_task=%d\n", np->cur_task); 1627 - printk(KERN_DEBUG "TxStatus=%04x\n", ioread16(ioaddr + TxStatus)); 1628 - return 0; 1629 - } 1630 - 1631 1609 1632 1610 return rc; 1633 1611 }