This time, it checks for CAP_NET_ADMIN before adjusting the debug
level. (Duh)
Index: linux/drivers/net/eepro100.c
--- linux/drivers/net/eepro100.c 2000/09/06 19:54:42 1.4
+++ linux/drivers/net/eepro100.c 2000/10/02 22:44:12 1.4.8.2
@@ -1,4 +1,2 @@
-#define USE_IO
-
/* drivers/net/eepro100.c: An Intel i82557-559 Ethernet driver for Linux. */
/*
@@ -40,4 +38,9 @@
*/
+/*
+ * This might fix initialization problems. --Dragan
+ */
+#define USE_IO 1
+
static const char *version =
"eepro100.c:v1.09j-t 9/29/99 Donald Becker http://cesdis.gsfc.nasa.gov/linux/drivers/eepro100.html\n"
@@ -1148,6 +1151,4 @@ static void speedo_show_state(struct net
{
struct speedo_private *sp = (struct speedo_private *)dev->priv;
- long ioaddr = dev->base_addr;
- int phy_num = sp->phy[0] & 0x1f;
int i;
@@ -1176,4 +1177,8 @@ static void speedo_show_state(struct net
#if 0
+ {
+ long ioaddr = dev->base_addr;
+ int phy_num = sp->phy[0] & 0x1f;
+
for (i = 0; i < 16; i++) {
/* FIXME: what does it mean? --SAW */
@@ -1182,4 +1187,5 @@ static void speedo_show_state(struct net
dev->name, phy_num, i, mdio_read(ioaddr, phy_num, i));
}
+ }
#endif
@@ -1509,5 +1515,5 @@ static void speedo_interrupt(int irq, vo
outw(status & 0xfc00, ioaddr + SCBStatus);
- if (speedo_debug > 4)
+ if (speedo_debug > 3)
printk(KERN_DEBUG "%s: interrupt status=%#4.4x.\n",
dev->name, status);
@@ -1932,4 +1938,11 @@ static int speedo_ioctl(struct net_devic
end_bh_atomic();
return 0;
+ case SIOCDEVPRIVATE+5: /* Set speedo debug level */
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+ speedo_debug = *(int *)rq->ifr_data;
+ printk(KERN_DEBUG "%s: set debug level to [%d].\n",
+ dev->name, speedo_debug);
+ return 0;
default:
return -EOPNOTSUPP;
@@ -1971,4 +1984,8 @@ static void set_rx_mode(struct net_devic
* set again later. */
sp->rx_mode = -1;
+ if(speedo_debug < 2)
+ printk(KERN_DEBUG "%s: The Tx ring is full -- don't add anything!\n"
+ "sp->cur_tx[%d], sp->dirty_tx[%d], TX_RING_SIZE[%d], TX_MULTICAST_SIZE[%d]\n",
+ dev->name, sp->cur_tx, sp->dirty_tx, TX_RING_SIZE, TX_MULTICAST_SIZE);
return;
}
-- Chip Salzenberg - a.k.a. - <chip@valinux.com> "I wanted to play hopscotch with the impenetrable mystery of existence, but he stepped in a wormhole and had to go in early." // MST3K - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Oct 07 2000 - 21:00:11 EST