Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] pcnet32: constify function table
From: Stephen Hemminger @ 2011-09-16 21:06 UTC (permalink / raw)
  To: Don Fry, David Miller; +Cc: netdev

Function tables need to be const to prevent malicious use.

This is compile tested only.
Gleaned from PAX.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/ethernet/amd/pcnet32.c |  202 +++++++++++++++++++++++++-------------------------
 1 file changed, 101 insertions(+), 101 deletions(-)

--- a/drivers/net/ethernet/amd/pcnet32.c	2011-09-16 13:12:56.421369669 -0700
+++ b/drivers/net/ethernet/amd/pcnet32.c	2011-09-16 13:18:39.973385541 -0700
@@ -270,7 +270,7 @@ struct pcnet32_private {
 	struct sk_buff		**rx_skbuff;
 	dma_addr_t		*tx_dma_addr;
 	dma_addr_t		*rx_dma_addr;
-	struct pcnet32_access	a;
+	const struct pcnet32_access *a;
 	spinlock_t		lock;		/* Guard lock */
 	unsigned int		cur_rx, cur_tx;	/* The next free ring entry */
 	unsigned int		rx_ring_size;	/* current rx ring size */
@@ -379,7 +379,7 @@ static int pcnet32_wio_check(unsigned lo
 	return inw(addr + PCNET32_WIO_RAP) == 88;
 }
 
-static struct pcnet32_access pcnet32_wio = {
+static const struct pcnet32_access pcnet32_wio = {
 	.read_csr = pcnet32_wio_read_csr,
 	.write_csr = pcnet32_wio_write_csr,
 	.read_bcr = pcnet32_wio_read_bcr,
@@ -434,7 +434,7 @@ static int pcnet32_dwio_check(unsigned l
 	return (inl(addr + PCNET32_DWIO_RAP) & 0xffff) == 88;
 }
 
-static struct pcnet32_access pcnet32_dwio = {
+static const struct pcnet32_access pcnet32_dwio = {
 	.read_csr = pcnet32_dwio_read_csr,
 	.write_csr = pcnet32_dwio_write_csr,
 	.read_bcr = pcnet32_dwio_read_bcr,
@@ -460,9 +460,9 @@ static void pcnet32_netif_start(struct n
 	u16 val;
 
 	netif_wake_queue(dev);
-	val = lp->a.read_csr(ioaddr, CSR3);
+	val = lp->a->read_csr(ioaddr, CSR3);
 	val &= 0x00ff;
-	lp->a.write_csr(ioaddr, CSR3, val);
+	lp->a->write_csr(ioaddr, CSR3, val);
 	napi_enable(&lp->napi);
 }
 
@@ -730,7 +730,7 @@ static u32 pcnet32_get_link(struct net_d
 		r = mii_link_ok(&lp->mii_if);
 	} else if (lp->chip_version >= PCNET32_79C970A) {
 		ulong ioaddr = dev->base_addr;	/* card base I/O address */
-		r = (lp->a.read_bcr(ioaddr, 4) != 0xc0);
+		r = (lp->a->read_bcr(ioaddr, 4) != 0xc0);
 	} else {	/* can not detect link on really old chips */
 		r = 1;
 	}
@@ -792,7 +792,7 @@ static int pcnet32_set_ringparam(struct
 		pcnet32_netif_stop(dev);
 
 	spin_lock_irqsave(&lp->lock, flags);
-	lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);	/* stop the chip */
+	lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);	/* stop the chip */
 
 	size = min(ering->tx_pending, (unsigned int)TX_MAX_RING_SIZE);
 
@@ -868,7 +868,7 @@ static void pcnet32_ethtool_test(struct
 static int pcnet32_loopback_test(struct net_device *dev, uint64_t * data1)
 {
 	struct pcnet32_private *lp = netdev_priv(dev);
-	struct pcnet32_access *a = &lp->a;	/* access to registers */
+	const struct pcnet32_access *a = lp->a;	/* access to registers */
 	ulong ioaddr = dev->base_addr;	/* card base I/O address */
 	struct sk_buff *skb;	/* sk buff */
 	int x, i;		/* counters */
@@ -888,21 +888,21 @@ static int pcnet32_loopback_test(struct
 		pcnet32_netif_stop(dev);
 
 	spin_lock_irqsave(&lp->lock, flags);
-	lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);	/* stop the chip */
+	lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);	/* stop the chip */
 
 	numbuffs = min(numbuffs, (int)min(lp->rx_ring_size, lp->tx_ring_size));
 
 	/* Reset the PCNET32 */
-	lp->a.reset(ioaddr);
-	lp->a.write_csr(ioaddr, CSR4, 0x0915);	/* auto tx pad */
+	lp->a->reset(ioaddr);
+	lp->a->write_csr(ioaddr, CSR4, 0x0915);	/* auto tx pad */
 
 	/* switch pcnet32 to 32bit mode */
-	lp->a.write_bcr(ioaddr, 20, 2);
+	lp->a->write_bcr(ioaddr, 20, 2);
 
 	/* purge & init rings but don't actually restart */
 	pcnet32_restart(dev, 0x0000);
 
-	lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);	/* Set STOP bit */
+	lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);	/* Set STOP bit */
 
 	/* Initialize Transmit buffers. */
 	size = data_len + 15;
@@ -947,10 +947,10 @@ static int pcnet32_loopback_test(struct
 
 	/* set int loopback in CSR15 */
 	x = a->read_csr(ioaddr, CSR15) & 0xfffc;
-	lp->a.write_csr(ioaddr, CSR15, x | 0x0044);
+	lp->a->write_csr(ioaddr, CSR15, x | 0x0044);
 
 	teststatus = cpu_to_le16(0x8000);
-	lp->a.write_csr(ioaddr, CSR0, CSR0_START);	/* Set STRT bit */
+	lp->a->write_csr(ioaddr, CSR0, CSR0_START);	/* Set STRT bit */
 
 	/* Check status of descriptors */
 	for (x = 0; x < numbuffs; x++) {
@@ -969,7 +969,7 @@ static int pcnet32_loopback_test(struct
 		}
 	}
 
-	lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);	/* Set STOP bit */
+	lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);	/* Set STOP bit */
 	wmb();
 	if (netif_msg_hw(lp) && netif_msg_pktdata(lp)) {
 		netdev_printk(KERN_DEBUG, dev, "RX loopback packets:\n");
@@ -1015,7 +1015,7 @@ clean_up:
 		pcnet32_restart(dev, CSR0_NORMAL);
 	} else {
 		pcnet32_purge_rx_ring(dev);
-		lp->a.write_bcr(ioaddr, 20, 4);	/* return to 16bit mode */
+		lp->a->write_bcr(ioaddr, 20, 4);	/* return to 16bit mode */
 	}
 	spin_unlock_irqrestore(&lp->lock, flags);
 
@@ -1026,7 +1026,7 @@ static int pcnet32_set_phys_id(struct ne
 			       enum ethtool_phys_id_state state)
 {
 	struct pcnet32_private *lp = netdev_priv(dev);
-	struct pcnet32_access *a = &lp->a;
+	const struct pcnet32_access *a = lp->a;
 	ulong ioaddr = dev->base_addr;
 	unsigned long flags;
 	int i;
@@ -1067,7 +1067,7 @@ static int pcnet32_suspend(struct net_de
 {
 	int csr5;
 	struct pcnet32_private *lp = netdev_priv(dev);
-	struct pcnet32_access *a = &lp->a;
+	const struct pcnet32_access *a = lp->a;
 	ulong ioaddr = dev->base_addr;
 	int ticks;
 
@@ -1324,8 +1324,8 @@ static int pcnet32_poll(struct napi_stru
 	spin_lock_irqsave(&lp->lock, flags);
 	if (pcnet32_tx(dev)) {
 		/* reset the chip to clear the error condition, then restart */
-		lp->a.reset(ioaddr);
-		lp->a.write_csr(ioaddr, CSR4, 0x0915);	/* auto tx pad */
+		lp->a->reset(ioaddr);
+		lp->a->write_csr(ioaddr, CSR4, 0x0915);	/* auto tx pad */
 		pcnet32_restart(dev, CSR0_START);
 		netif_wake_queue(dev);
 	}
@@ -1337,12 +1337,12 @@ static int pcnet32_poll(struct napi_stru
 		__napi_complete(napi);
 
 		/* clear interrupt masks */
-		val = lp->a.read_csr(ioaddr, CSR3);
+		val = lp->a->read_csr(ioaddr, CSR3);
 		val &= 0x00ff;
-		lp->a.write_csr(ioaddr, CSR3, val);
+		lp->a->write_csr(ioaddr, CSR3, val);
 
 		/* Set interrupt enable. */
-		lp->a.write_csr(ioaddr, CSR0, CSR0_INTEN);
+		lp->a->write_csr(ioaddr, CSR0, CSR0_INTEN);
 
 		spin_unlock_irqrestore(&lp->lock, flags);
 	}
@@ -1365,7 +1365,7 @@ static void pcnet32_get_regs(struct net_
 	int i, csr0;
 	u16 *buff = ptr;
 	struct pcnet32_private *lp = netdev_priv(dev);
-	struct pcnet32_access *a = &lp->a;
+	const struct pcnet32_access *a = lp->a;
 	ulong ioaddr = dev->base_addr;
 	unsigned long flags;
 
@@ -1401,9 +1401,9 @@ static void pcnet32_get_regs(struct net_
 		for (j = 0; j < PCNET32_MAX_PHYS; j++) {
 			if (lp->phymask & (1 << j)) {
 				for (i = 0; i < PCNET32_REGS_PER_PHY; i++) {
-					lp->a.write_bcr(ioaddr, 33,
+					lp->a->write_bcr(ioaddr, 33,
 							(j << 5) | i);
-					*buff++ = lp->a.read_bcr(ioaddr, 34);
+					*buff++ = lp->a->read_bcr(ioaddr, 34);
 				}
 			}
 		}
@@ -1528,7 +1528,7 @@ pcnet32_probe1(unsigned long ioaddr, int
 	int chip_version;
 	char *chipname;
 	struct net_device *dev;
-	struct pcnet32_access *a = NULL;
+	const struct pcnet32_access *a = NULL;
 	u8 promaddr[6];
 	int ret = -ENODEV;
 
@@ -1785,7 +1785,7 @@ pcnet32_probe1(unsigned long ioaddr, int
 	    ((cards_found >= MAX_UNITS) || full_duplex[cards_found]))
 		lp->options |= PCNET32_PORT_FD;
 
-	lp->a = *a;
+	lp->a = a;
 
 	/* prior to register_netdev, dev->name is not yet correct */
 	if (pcnet32_alloc_ring(dev, pci_name(lp->pci_dev))) {
@@ -1844,7 +1844,7 @@ pcnet32_probe1(unsigned long ioaddr, int
 	if (lp->mii) {
 		/* lp->phycount and lp->phymask are set to 0 by memset above */
 
-		lp->mii_if.phy_id = ((lp->a.read_bcr(ioaddr, 33)) >> 5) & 0x1f;
+		lp->mii_if.phy_id = ((lp->a->read_bcr(ioaddr, 33)) >> 5) & 0x1f;
 		/* scan for PHYs */
 		for (i = 0; i < PCNET32_MAX_PHYS; i++) {
 			unsigned short id1, id2;
@@ -1864,7 +1864,7 @@ pcnet32_probe1(unsigned long ioaddr, int
 				pr_info("Found PHY %04x:%04x at address %d\n",
 					id1, id2, i);
 		}
-		lp->a.write_bcr(ioaddr, 33, (lp->mii_if.phy_id) << 5);
+		lp->a->write_bcr(ioaddr, 33, (lp->mii_if.phy_id) << 5);
 		if (lp->phycount > 1)
 			lp->options |= PCNET32_PORT_MII;
 	}
@@ -2020,10 +2020,10 @@ static int pcnet32_open(struct net_devic
 	}
 
 	/* Reset the PCNET32 */
-	lp->a.reset(ioaddr);
+	lp->a->reset(ioaddr);
 
 	/* switch pcnet32 to 32bit mode */
-	lp->a.write_bcr(ioaddr, 20, 2);
+	lp->a->write_bcr(ioaddr, 20, 2);
 
 	netif_printk(lp, ifup, KERN_DEBUG, dev,
 		     "%s() irq %d tx/rx rings %#x/%#x init %#x\n",
@@ -2032,14 +2032,14 @@ static int pcnet32_open(struct net_devic
 		     (u32) (lp->init_dma_addr));
 
 	/* set/reset autoselect bit */
-	val = lp->a.read_bcr(ioaddr, 2) & ~2;
+	val = lp->a->read_bcr(ioaddr, 2) & ~2;
 	if (lp->options & PCNET32_PORT_ASEL)
 		val |= 2;
-	lp->a.write_bcr(ioaddr, 2, val);
+	lp->a->write_bcr(ioaddr, 2, val);
 
 	/* handle full duplex setting */
 	if (lp->mii_if.full_duplex) {
-		val = lp->a.read_bcr(ioaddr, 9) & ~3;
+		val = lp->a->read_bcr(ioaddr, 9) & ~3;
 		if (lp->options & PCNET32_PORT_FD) {
 			val |= 1;
 			if (lp->options == (PCNET32_PORT_FD | PCNET32_PORT_AUI))
@@ -2049,14 +2049,14 @@ static int pcnet32_open(struct net_devic
 			if (lp->chip_version == 0x2627)
 				val |= 3;
 		}
-		lp->a.write_bcr(ioaddr, 9, val);
+		lp->a->write_bcr(ioaddr, 9, val);
 	}
 
 	/* set/reset GPSI bit in test register */
-	val = lp->a.read_csr(ioaddr, 124) & ~0x10;
+	val = lp->a->read_csr(ioaddr, 124) & ~0x10;
 	if ((lp->options & PCNET32_PORT_PORTSEL) == PCNET32_PORT_GPSI)
 		val |= 0x10;
-	lp->a.write_csr(ioaddr, 124, val);
+	lp->a->write_csr(ioaddr, 124, val);
 
 	/* Allied Telesyn AT 2700/2701 FX are 100Mbit only and do not negotiate */
 	if (pdev && pdev->subsystem_vendor == PCI_VENDOR_ID_AT &&
@@ -2075,24 +2075,24 @@ static int pcnet32_open(struct net_devic
 		 * duplex, and/or enable auto negotiation, and clear DANAS
 		 */
 		if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) {
-			lp->a.write_bcr(ioaddr, 32,
-					lp->a.read_bcr(ioaddr, 32) | 0x0080);
+			lp->a->write_bcr(ioaddr, 32,
+					lp->a->read_bcr(ioaddr, 32) | 0x0080);
 			/* disable Auto Negotiation, set 10Mpbs, HD */
-			val = lp->a.read_bcr(ioaddr, 32) & ~0xb8;
+			val = lp->a->read_bcr(ioaddr, 32) & ~0xb8;
 			if (lp->options & PCNET32_PORT_FD)
 				val |= 0x10;
 			if (lp->options & PCNET32_PORT_100)
 				val |= 0x08;
-			lp->a.write_bcr(ioaddr, 32, val);
+			lp->a->write_bcr(ioaddr, 32, val);
 		} else {
 			if (lp->options & PCNET32_PORT_ASEL) {
-				lp->a.write_bcr(ioaddr, 32,
-						lp->a.read_bcr(ioaddr,
+				lp->a->write_bcr(ioaddr, 32,
+						lp->a->read_bcr(ioaddr,
 							       32) | 0x0080);
 				/* enable auto negotiate, setup, disable fd */
-				val = lp->a.read_bcr(ioaddr, 32) & ~0x98;
+				val = lp->a->read_bcr(ioaddr, 32) & ~0x98;
 				val |= 0x20;
-				lp->a.write_bcr(ioaddr, 32, val);
+				lp->a->write_bcr(ioaddr, 32, val);
 			}
 		}
 	} else {
@@ -2105,10 +2105,10 @@ static int pcnet32_open(struct net_devic
 		 * There is really no good other way to handle multiple PHYs
 		 * other than turning off all automatics
 		 */
-		val = lp->a.read_bcr(ioaddr, 2);
-		lp->a.write_bcr(ioaddr, 2, val & ~2);
-		val = lp->a.read_bcr(ioaddr, 32);
-		lp->a.write_bcr(ioaddr, 32, val & ~(1 << 7));	/* stop MII manager */
+		val = lp->a->read_bcr(ioaddr, 2);
+		lp->a->write_bcr(ioaddr, 2, val & ~2);
+		val = lp->a->read_bcr(ioaddr, 32);
+		lp->a->write_bcr(ioaddr, 32, val & ~(1 << 7));	/* stop MII manager */
 
 		if (!(lp->options & PCNET32_PORT_ASEL)) {
 			/* setup ecmd */
@@ -2118,7 +2118,7 @@ static int pcnet32_open(struct net_devic
 			ethtool_cmd_speed_set(&ecmd,
 					      (lp->options & PCNET32_PORT_100) ?
 					      SPEED_100 : SPEED_10);
-			bcr9 = lp->a.read_bcr(ioaddr, 9);
+			bcr9 = lp->a->read_bcr(ioaddr, 9);
 
 			if (lp->options & PCNET32_PORT_FD) {
 				ecmd.duplex = DUPLEX_FULL;
@@ -2127,7 +2127,7 @@ static int pcnet32_open(struct net_devic
 				ecmd.duplex = DUPLEX_HALF;
 				bcr9 |= ~(1 << 0);
 			}
-			lp->a.write_bcr(ioaddr, 9, bcr9);
+			lp->a->write_bcr(ioaddr, 9, bcr9);
 		}
 
 		for (i = 0; i < PCNET32_MAX_PHYS; i++) {
@@ -2158,9 +2158,9 @@ static int pcnet32_open(struct net_devic
 
 #ifdef DO_DXSUFLO
 	if (lp->dxsuflo) {	/* Disable transmit stop on underflow */
-		val = lp->a.read_csr(ioaddr, CSR3);
+		val = lp->a->read_csr(ioaddr, CSR3);
 		val |= 0x40;
-		lp->a.write_csr(ioaddr, CSR3, val);
+		lp->a->write_csr(ioaddr, CSR3, val);
 	}
 #endif
 
@@ -2176,11 +2176,11 @@ static int pcnet32_open(struct net_devic
 	napi_enable(&lp->napi);
 
 	/* Re-initialize the PCNET32, and start it when done. */
-	lp->a.write_csr(ioaddr, 1, (lp->init_dma_addr & 0xffff));
-	lp->a.write_csr(ioaddr, 2, (lp->init_dma_addr >> 16));
+	lp->a->write_csr(ioaddr, 1, (lp->init_dma_addr & 0xffff));
+	lp->a->write_csr(ioaddr, 2, (lp->init_dma_addr >> 16));
 
-	lp->a.write_csr(ioaddr, CSR4, 0x0915);	/* auto tx pad */
-	lp->a.write_csr(ioaddr, CSR0, CSR0_INIT);
+	lp->a->write_csr(ioaddr, CSR4, 0x0915);	/* auto tx pad */
+	lp->a->write_csr(ioaddr, CSR0, CSR0_INIT);
 
 	netif_start_queue(dev);
 
@@ -2192,19 +2192,19 @@ static int pcnet32_open(struct net_devic
 
 	i = 0;
 	while (i++ < 100)
-		if (lp->a.read_csr(ioaddr, CSR0) & CSR0_IDON)
+		if (lp->a->read_csr(ioaddr, CSR0) & CSR0_IDON)
 			break;
 	/*
 	 * We used to clear the InitDone bit, 0x0100, here but Mark Stockton
 	 * reports that doing so triggers a bug in the '974.
 	 */
-	lp->a.write_csr(ioaddr, CSR0, CSR0_NORMAL);
+	lp->a->write_csr(ioaddr, CSR0, CSR0_NORMAL);
 
 	netif_printk(lp, ifup, KERN_DEBUG, dev,
 		     "pcnet32 open after %d ticks, init block %#x csr0 %4.4x\n",
 		     i,
 		     (u32) (lp->init_dma_addr),
-		     lp->a.read_csr(ioaddr, CSR0));
+		     lp->a->read_csr(ioaddr, CSR0));
 
 	spin_unlock_irqrestore(&lp->lock, flags);
 
@@ -2218,7 +2218,7 @@ err_free_ring:
 	 * Switch back to 16bit mode to avoid problems with dumb
 	 * DOS packet driver after a warm reboot
 	 */
-	lp->a.write_bcr(ioaddr, 20, 4);
+	lp->a->write_bcr(ioaddr, 20, 4);
 
 err_free_irq:
 	spin_unlock_irqrestore(&lp->lock, flags);
@@ -2323,7 +2323,7 @@ static void pcnet32_restart(struct net_d
 
 	/* wait for stop */
 	for (i = 0; i < 100; i++)
-		if (lp->a.read_csr(ioaddr, CSR0) & CSR0_STOP)
+		if (lp->a->read_csr(ioaddr, CSR0) & CSR0_STOP)
 			break;
 
 	if (i >= 100)
@@ -2335,13 +2335,13 @@ static void pcnet32_restart(struct net_d
 		return;
 
 	/* ReInit Ring */
-	lp->a.write_csr(ioaddr, CSR0, CSR0_INIT);
+	lp->a->write_csr(ioaddr, CSR0, CSR0_INIT);
 	i = 0;
 	while (i++ < 1000)
-		if (lp->a.read_csr(ioaddr, CSR0) & CSR0_IDON)
+		if (lp->a->read_csr(ioaddr, CSR0) & CSR0_IDON)
 			break;
 
-	lp->a.write_csr(ioaddr, CSR0, csr0_bits);
+	lp->a->write_csr(ioaddr, CSR0, csr0_bits);
 }
 
 static void pcnet32_tx_timeout(struct net_device *dev)
@@ -2353,8 +2353,8 @@ static void pcnet32_tx_timeout(struct ne
 	/* Transmitter timeout, serious problems. */
 	if (pcnet32_debug & NETIF_MSG_DRV)
 		pr_err("%s: transmit timed out, status %4.4x, resetting\n",
-		       dev->name, lp->a.read_csr(ioaddr, CSR0));
-	lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);
+		       dev->name, lp->a->read_csr(ioaddr, CSR0));
+	lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);
 	dev->stats.tx_errors++;
 	if (netif_msg_tx_err(lp)) {
 		int i;
@@ -2397,7 +2397,7 @@ static netdev_tx_t pcnet32_start_xmit(st
 
 	netif_printk(lp, tx_queued, KERN_DEBUG, dev,
 		     "%s() called, csr0 %4.4x\n",
-		     __func__, lp->a.read_csr(ioaddr, CSR0));
+		     __func__, lp->a->read_csr(ioaddr, CSR0));
 
 	/* Default status -- will not enable Successful-TxDone
 	 * interrupt when that option is available to us.
@@ -2427,7 +2427,7 @@ static netdev_tx_t pcnet32_start_xmit(st
 	dev->stats.tx_bytes += skb->len;
 
 	/* Trigger an immediate send poll. */
-	lp->a.write_csr(ioaddr, CSR0, CSR0_INTEN | CSR0_TXPOLL);
+	lp->a->write_csr(ioaddr, CSR0, CSR0_INTEN | CSR0_TXPOLL);
 
 	if (lp->tx_ring[(entry + 1) & lp->tx_mod_mask].base != 0) {
 		lp->tx_full = 1;
@@ -2452,16 +2452,16 @@ pcnet32_interrupt(int irq, void *dev_id)
 
 	spin_lock(&lp->lock);
 
-	csr0 = lp->a.read_csr(ioaddr, CSR0);
+	csr0 = lp->a->read_csr(ioaddr, CSR0);
 	while ((csr0 & 0x8f00) && --boguscnt >= 0) {
 		if (csr0 == 0xffff)
 			break;	/* PCMCIA remove happened */
 		/* Acknowledge all of the current interrupt sources ASAP. */
-		lp->a.write_csr(ioaddr, CSR0, csr0 & ~0x004f);
+		lp->a->write_csr(ioaddr, CSR0, csr0 & ~0x004f);
 
 		netif_printk(lp, intr, KERN_DEBUG, dev,
 			     "interrupt  csr0=%#2.2x new csr=%#2.2x\n",
-			     csr0, lp->a.read_csr(ioaddr, CSR0));
+			     csr0, lp->a->read_csr(ioaddr, CSR0));
 
 		/* Log misc errors. */
 		if (csr0 & 0x4000)
@@ -2488,19 +2488,19 @@ pcnet32_interrupt(int irq, void *dev_id)
 		if (napi_schedule_prep(&lp->napi)) {
 			u16 val;
 			/* set interrupt masks */
-			val = lp->a.read_csr(ioaddr, CSR3);
+			val = lp->a->read_csr(ioaddr, CSR3);
 			val |= 0x5f00;
-			lp->a.write_csr(ioaddr, CSR3, val);
+			lp->a->write_csr(ioaddr, CSR3, val);
 
 			__napi_schedule(&lp->napi);
 			break;
 		}
-		csr0 = lp->a.read_csr(ioaddr, CSR0);
+		csr0 = lp->a->read_csr(ioaddr, CSR0);
 	}
 
 	netif_printk(lp, intr, KERN_DEBUG, dev,
 		     "exiting interrupt, csr0=%#4.4x\n",
-		     lp->a.read_csr(ioaddr, CSR0));
+		     lp->a->read_csr(ioaddr, CSR0));
 
 	spin_unlock(&lp->lock);
 
@@ -2520,20 +2520,20 @@ static int pcnet32_close(struct net_devi
 
 	spin_lock_irqsave(&lp->lock, flags);
 
-	dev->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112);
+	dev->stats.rx_missed_errors = lp->a->read_csr(ioaddr, 112);
 
 	netif_printk(lp, ifdown, KERN_DEBUG, dev,
 		     "Shutting down ethercard, status was %2.2x\n",
-		     lp->a.read_csr(ioaddr, CSR0));
+		     lp->a->read_csr(ioaddr, CSR0));
 
 	/* We stop the PCNET32 here -- it occasionally polls memory if we don't. */
-	lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);
+	lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);
 
 	/*
 	 * Switch back to 16bit mode to avoid problems with dumb
 	 * DOS packet driver after a warm reboot
 	 */
-	lp->a.write_bcr(ioaddr, 20, 4);
+	lp->a->write_bcr(ioaddr, 20, 4);
 
 	spin_unlock_irqrestore(&lp->lock, flags);
 
@@ -2556,7 +2556,7 @@ static struct net_device_stats *pcnet32_
 	unsigned long flags;
 
 	spin_lock_irqsave(&lp->lock, flags);
-	dev->stats.rx_missed_errors = lp->a.read_csr(ioaddr, 112);
+	dev->stats.rx_missed_errors = lp->a->read_csr(ioaddr, 112);
 	spin_unlock_irqrestore(&lp->lock, flags);
 
 	return &dev->stats;
@@ -2577,10 +2577,10 @@ static void pcnet32_load_multicast(struc
 	if (dev->flags & IFF_ALLMULTI) {
 		ib->filter[0] = cpu_to_le32(~0U);
 		ib->filter[1] = cpu_to_le32(~0U);
-		lp->a.write_csr(ioaddr, PCNET32_MC_FILTER, 0xffff);
-		lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+1, 0xffff);
-		lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+2, 0xffff);
-		lp->a.write_csr(ioaddr, PCNET32_MC_FILTER+3, 0xffff);
+		lp->a->write_csr(ioaddr, PCNET32_MC_FILTER, 0xffff);
+		lp->a->write_csr(ioaddr, PCNET32_MC_FILTER+1, 0xffff);
+		lp->a->write_csr(ioaddr, PCNET32_MC_FILTER+2, 0xffff);
+		lp->a->write_csr(ioaddr, PCNET32_MC_FILTER+3, 0xffff);
 		return;
 	}
 	/* clear the multicast filter */
@@ -2594,7 +2594,7 @@ static void pcnet32_load_multicast(struc
 		mcast_table[crc >> 4] |= cpu_to_le16(1 << (crc & 0xf));
 	}
 	for (i = 0; i < 4; i++)
-		lp->a.write_csr(ioaddr, PCNET32_MC_FILTER + i,
+		lp->a->write_csr(ioaddr, PCNET32_MC_FILTER + i,
 				le16_to_cpu(mcast_table[i]));
 }
 
@@ -2609,28 +2609,28 @@ static void pcnet32_set_multicast_list(s
 
 	spin_lock_irqsave(&lp->lock, flags);
 	suspended = pcnet32_suspend(dev, &flags, 0);
-	csr15 = lp->a.read_csr(ioaddr, CSR15);
+	csr15 = lp->a->read_csr(ioaddr, CSR15);
 	if (dev->flags & IFF_PROMISC) {
 		/* Log any net taps. */
 		netif_info(lp, hw, dev, "Promiscuous mode enabled\n");
 		lp->init_block->mode =
 		    cpu_to_le16(0x8000 | (lp->options & PCNET32_PORT_PORTSEL) <<
 				7);
-		lp->a.write_csr(ioaddr, CSR15, csr15 | 0x8000);
+		lp->a->write_csr(ioaddr, CSR15, csr15 | 0x8000);
 	} else {
 		lp->init_block->mode =
 		    cpu_to_le16((lp->options & PCNET32_PORT_PORTSEL) << 7);
-		lp->a.write_csr(ioaddr, CSR15, csr15 & 0x7fff);
+		lp->a->write_csr(ioaddr, CSR15, csr15 & 0x7fff);
 		pcnet32_load_multicast(dev);
 	}
 
 	if (suspended) {
 		int csr5;
 		/* clear SUSPEND (SPND) - CSR5 bit 0 */
-		csr5 = lp->a.read_csr(ioaddr, CSR5);
-		lp->a.write_csr(ioaddr, CSR5, csr5 & (~CSR5_SUSPEND));
+		csr5 = lp->a->read_csr(ioaddr, CSR5);
+		lp->a->write_csr(ioaddr, CSR5, csr5 & (~CSR5_SUSPEND));
 	} else {
-		lp->a.write_csr(ioaddr, CSR0, CSR0_STOP);
+		lp->a->write_csr(ioaddr, CSR0, CSR0_STOP);
 		pcnet32_restart(dev, CSR0_NORMAL);
 		netif_wake_queue(dev);
 	}
@@ -2648,8 +2648,8 @@ static int mdio_read(struct net_device *
 	if (!lp->mii)
 		return 0;
 
-	lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
-	val_out = lp->a.read_bcr(ioaddr, 34);
+	lp->a->write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
+	val_out = lp->a->read_bcr(ioaddr, 34);
 
 	return val_out;
 }
@@ -2663,8 +2663,8 @@ static void mdio_write(struct net_device
 	if (!lp->mii)
 		return;
 
-	lp->a.write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
-	lp->a.write_bcr(ioaddr, 34, val);
+	lp->a->write_bcr(ioaddr, 33, ((phy_id & 0x1f) << 5) | (reg_num & 0x1f));
+	lp->a->write_bcr(ioaddr, 34, val);
 }
 
 static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
@@ -2741,7 +2741,7 @@ static void pcnet32_check_media(struct n
 		curr_link = mii_link_ok(&lp->mii_if);
 	} else {
 		ulong ioaddr = dev->base_addr;	/* card base I/O address */
-		curr_link = (lp->a.read_bcr(ioaddr, 4) != 0xc0);
+		curr_link = (lp->a->read_bcr(ioaddr, 4) != 0xc0);
 	}
 	if (!curr_link) {
 		if (prev_link || verbose) {
@@ -2764,13 +2764,13 @@ static void pcnet32_check_media(struct n
 					    (ecmd.duplex == DUPLEX_FULL)
 					    ? "full" : "half");
 			}
-			bcr9 = lp->a.read_bcr(dev->base_addr, 9);
+			bcr9 = lp->a->read_bcr(dev->base_addr, 9);
 			if ((bcr9 & (1 << 0)) != lp->mii_if.full_duplex) {
 				if (lp->mii_if.full_duplex)
 					bcr9 |= (1 << 0);
 				else
 					bcr9 &= ~(1 << 0);
-				lp->a.write_bcr(dev->base_addr, 9, bcr9);
+				lp->a->write_bcr(dev->base_addr, 9, bcr9);
 			}
 		} else {
 			netif_info(lp, link, dev, "link up\n");

^ permalink raw reply

* [PATCH] wan: make LAPB callbacks const
From: Stephen Hemminger @ 2011-09-16 21:04 UTC (permalink / raw)
  To: Krzysztof Halasa, David S. Miller; +Cc: netdev

This is compile tested only.
Suggested by dumpster diving in PAX.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


---
 drivers/net/wan/hdlc_x25.c  |   16 ++++++++--------
 drivers/net/wan/lapbether.c |    3 +--
 drivers/net/wan/x25_asy.c   |    3 +--
 include/linux/lapb.h        |    3 ++-
 include/net/lapb.h          |    2 +-
 net/lapb/lapb_iface.c       |   29 +++++++++++++++--------------
 6 files changed, 28 insertions(+), 28 deletions(-)

--- a/drivers/net/wan/hdlc_x25.c	2011-09-16 11:30:01.849087557 -0700
+++ b/drivers/net/wan/hdlc_x25.c	2011-09-16 11:31:04.901093255 -0700
@@ -134,15 +134,15 @@ static netdev_tx_t x25_xmit(struct sk_bu
 
 static int x25_open(struct net_device *dev)
 {
-	struct lapb_register_struct cb;
 	int result;
-
-	cb.connect_confirmation = x25_connected;
-	cb.connect_indication = x25_connected;
-	cb.disconnect_confirmation = x25_disconnected;
-	cb.disconnect_indication = x25_disconnected;
-	cb.data_indication = x25_data_indication;
-	cb.data_transmit = x25_data_transmit;
+	static const struct lapb_register_struct cb = {
+		.connect_confirmation = x25_connected,
+		.connect_indication = x25_connected,
+		.disconnect_confirmation = x25_disconnected,
+		.disconnect_indication = x25_disconnected,
+		.data_indication = x25_data_indication,
+		.data_transmit = x25_data_transmit,
+	};
 
 	result = lapb_register(dev, &cb);
 	if (result != LAPB_OK)
--- a/drivers/net/wan/lapbether.c	2011-09-16 11:31:22.609091232 -0700
+++ b/drivers/net/wan/lapbether.c	2011-09-16 11:31:30.597091736 -0700
@@ -259,14 +259,13 @@ static int lapbeth_set_mac_address(struc
 }
 
 
-static struct lapb_register_struct lapbeth_callbacks = {
+static const struct lapb_register_struct lapbeth_callbacks = {
 	.connect_confirmation    = lapbeth_connected,
 	.connect_indication      = lapbeth_connected,
 	.disconnect_confirmation = lapbeth_disconnected,
 	.disconnect_indication   = lapbeth_disconnected,
 	.data_indication         = lapbeth_data_indication,
 	.data_transmit           = lapbeth_data_transmit,
-
 };
 
 /*
--- a/drivers/net/wan/x25_asy.c	2011-09-16 11:31:38.833091828 -0700
+++ b/drivers/net/wan/x25_asy.c	2011-09-16 11:31:46.317091608 -0700
@@ -434,14 +434,13 @@ static void x25_asy_disconnected(struct
 	netif_rx(skb);
 }
 
-static struct lapb_register_struct x25_asy_callbacks = {
+static const struct lapb_register_struct x25_asy_callbacks = {
 	.connect_confirmation = x25_asy_connected,
 	.connect_indication = x25_asy_connected,
 	.disconnect_confirmation = x25_asy_disconnected,
 	.disconnect_indication = x25_asy_disconnected,
 	.data_indication = x25_asy_data_indication,
 	.data_transmit = x25_asy_data_transmit,
-
 };
 
 
--- a/include/linux/lapb.h	2011-09-16 11:32:21.021093958 -0700
+++ b/include/linux/lapb.h	2011-09-16 11:38:16.593110202 -0700
@@ -44,7 +44,8 @@ struct lapb_parms_struct {
 	unsigned int mode;
 };
 
-extern int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks);
+extern int lapb_register(struct net_device *dev,
+			 const struct lapb_register_struct *callbacks);
 extern int lapb_unregister(struct net_device *dev);
 extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms);
 extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms);
--- a/include/net/lapb.h	2011-09-16 11:32:21.037093954 -0700
+++ b/include/net/lapb.h	2011-09-16 11:34:34.361100045 -0700
@@ -95,7 +95,7 @@ struct lapb_cb {
 	struct sk_buff_head	write_queue;
 	struct sk_buff_head	ack_queue;
 	unsigned char		window;
-	struct lapb_register_struct callbacks;
+	const struct lapb_register_struct *callbacks;
 
 	/* FRMR control information */
 	struct lapb_frame	frmr_data;
--- a/net/lapb/lapb_iface.c	2011-09-16 11:32:21.053093960 -0700
+++ b/net/lapb/lapb_iface.c	2011-09-16 11:38:16.593110202 -0700
@@ -139,7 +139,8 @@ out:
 	return lapb;
 }
 
-int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks)
+int lapb_register(struct net_device *dev,
+		  const struct lapb_register_struct *callbacks)
 {
 	struct lapb_cb *lapb;
 	int rc = LAPB_BADTOKEN;
@@ -158,7 +159,7 @@ int lapb_register(struct net_device *dev
 		goto out;
 
 	lapb->dev       = dev;
-	lapb->callbacks = *callbacks;
+	lapb->callbacks = callbacks;
 
 	__lapb_insert_cb(lapb);
 
@@ -380,32 +381,32 @@ int lapb_data_received(struct net_device
 
 void lapb_connect_confirmation(struct lapb_cb *lapb, int reason)
 {
-	if (lapb->callbacks.connect_confirmation)
-		lapb->callbacks.connect_confirmation(lapb->dev, reason);
+	if (lapb->callbacks->connect_confirmation)
+		lapb->callbacks->connect_confirmation(lapb->dev, reason);
 }
 
 void lapb_connect_indication(struct lapb_cb *lapb, int reason)
 {
-	if (lapb->callbacks.connect_indication)
-		lapb->callbacks.connect_indication(lapb->dev, reason);
+	if (lapb->callbacks->connect_indication)
+		lapb->callbacks->connect_indication(lapb->dev, reason);
 }
 
 void lapb_disconnect_confirmation(struct lapb_cb *lapb, int reason)
 {
-	if (lapb->callbacks.disconnect_confirmation)
-		lapb->callbacks.disconnect_confirmation(lapb->dev, reason);
+	if (lapb->callbacks->disconnect_confirmation)
+		lapb->callbacks->disconnect_confirmation(lapb->dev, reason);
 }
 
 void lapb_disconnect_indication(struct lapb_cb *lapb, int reason)
 {
-	if (lapb->callbacks.disconnect_indication)
-		lapb->callbacks.disconnect_indication(lapb->dev, reason);
+	if (lapb->callbacks->disconnect_indication)
+		lapb->callbacks->disconnect_indication(lapb->dev, reason);
 }
 
 int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *skb)
 {
-	if (lapb->callbacks.data_indication)
-		return lapb->callbacks.data_indication(lapb->dev, skb);
+	if (lapb->callbacks->data_indication)
+		return lapb->callbacks->data_indication(lapb->dev, skb);
 
 	kfree_skb(skb);
 	return NET_RX_SUCCESS; /* For now; must be != NET_RX_DROP */
@@ -415,8 +416,8 @@ int lapb_data_transmit(struct lapb_cb *l
 {
 	int used = 0;
 
-	if (lapb->callbacks.data_transmit) {
-		lapb->callbacks.data_transmit(lapb->dev, skb);
+	if (lapb->callbacks->data_transmit) {
+		lapb->callbacks->data_transmit(lapb->dev, skb);
 		used = 1;
 	}
 

^ permalink raw reply

* [PATCH net-next] bna: make function tables cont
From: Stephen Hemminger @ 2011-09-16 21:09 UTC (permalink / raw)
  To: Rasesh Mody, David Miller; +Cc: netdev

To prevent malicious usage, all tables of pointers must be const.

Compile tested only.
Gleaned for PAX.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/ethernet/brocade/bna/bfa_ioc.h    |    2 -
 drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c |   36 ++++++++++----------------
 drivers/net/ethernet/brocade/bna/bna.h        |    4 +-
 drivers/net/ethernet/brocade/bna/bna_tx_rx.c  |    4 +-
 drivers/net/ethernet/brocade/bna/bnad.c       |   33 +++++++++++------------
 5 files changed, 36 insertions(+), 43 deletions(-)

--- a/drivers/net/ethernet/brocade/bna/bfa_ioc.h	2011-09-16 13:35:52.245432520 -0700
+++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.h	2011-09-16 13:35:54.593432627 -0700
@@ -199,7 +199,7 @@ struct bfa_ioc {
 	struct bfi_ioc_attr	*attr;
 	struct bfa_ioc_cbfn	*cbfn;
 	struct bfa_ioc_mbox_mod	mbox_mod;
-	struct bfa_ioc_hwif	*ioc_hwif;
+	const struct bfa_ioc_hwif *ioc_hwif;
 	struct bfa_iocpf	iocpf;
 	enum bfi_asic_gen	asic_gen;
 	enum bfi_asic_mode	asic_mode;
--- a/drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c	2011-09-16 13:35:52.273432521 -0700
+++ b/drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c	2011-09-16 13:40:28.501445140 -0700
@@ -49,21 +49,21 @@ static bool bfa_ioc_ct_sync_complete(str
 static enum bfa_status bfa_ioc_ct_pll_init(void __iomem *rb,
 				enum bfi_asic_mode asic_mode);
 
-static struct bfa_ioc_hwif nw_hwif_ct;
-
-static void
-bfa_ioc_set_ctx_hwif(struct bfa_ioc *ioc, struct bfa_ioc_hwif *hwif)
-{
-	hwif->ioc_firmware_lock = bfa_ioc_ct_firmware_lock;
-	hwif->ioc_firmware_unlock = bfa_ioc_ct_firmware_unlock;
-	hwif->ioc_notify_fail = bfa_ioc_ct_notify_fail;
-	hwif->ioc_ownership_reset = bfa_ioc_ct_ownership_reset;
-	hwif->ioc_sync_start = bfa_ioc_ct_sync_start;
-	hwif->ioc_sync_join = bfa_ioc_ct_sync_join;
-	hwif->ioc_sync_leave = bfa_ioc_ct_sync_leave;
-	hwif->ioc_sync_ack = bfa_ioc_ct_sync_ack;
-	hwif->ioc_sync_complete = bfa_ioc_ct_sync_complete;
-}
+static const struct bfa_ioc_hwif nw_hwif_ct = {
+	.ioc_pll_init	     = bfa_ioc_ct_pll_init,
+	.ioc_firmware_lock   = bfa_ioc_ct_firmware_lock,
+	.ioc_firmware_unlock = bfa_ioc_ct_firmware_unlock,
+	.ioc_reg_init	     = bfa_ioc_ct_reg_init,
+	.ioc_map_port	     = bfa_ioc_ct_map_port,
+	.ioc_isr_mode_set    = bfa_ioc_ct_isr_mode_set,
+	.ioc_notify_fail     = bfa_ioc_ct_notify_fail,
+	.ioc_ownership_reset = bfa_ioc_ct_ownership_reset,
+	.ioc_sync_start      = bfa_ioc_ct_sync_start,
+	.ioc_sync_join       = bfa_ioc_ct_sync_join,
+	.ioc_sync_leave	     = bfa_ioc_ct_sync_leave,
+	.ioc_sync_ack	     = bfa_ioc_ct_sync_ack,
+	.ioc_sync_complete   = bfa_ioc_ct_sync_complete,
+};
 
 /**
  * Called from bfa_ioc_attach() to map asic specific calls.
@@ -71,12 +71,6 @@ bfa_ioc_set_ctx_hwif(struct bfa_ioc *ioc
 void
 bfa_nw_ioc_set_ct_hwif(struct bfa_ioc *ioc)
 {
-	bfa_ioc_set_ctx_hwif(ioc, &nw_hwif_ct);
-
-	nw_hwif_ct.ioc_pll_init = bfa_ioc_ct_pll_init;
-	nw_hwif_ct.ioc_reg_init = bfa_ioc_ct_reg_init;
-	nw_hwif_ct.ioc_map_port = bfa_ioc_ct_map_port;
-	nw_hwif_ct.ioc_isr_mode_set = bfa_ioc_ct_isr_mode_set;
 	ioc->ioc_hwif = &nw_hwif_ct;
 }
 
--- a/drivers/net/ethernet/brocade/bna/bna.h	2011-09-16 13:35:52.257432521 -0700
+++ b/drivers/net/ethernet/brocade/bna/bna.h	2011-09-16 13:35:54.593432627 -0700
@@ -453,7 +453,7 @@ void bna_tx_res_req(int num_txq, int txq
 		    struct bna_res_info *res_info);
 struct bna_tx *bna_tx_create(struct bna *bna, struct bnad *bnad,
 			       struct bna_tx_config *tx_cfg,
-			       struct bna_tx_event_cbfn *tx_cbfn,
+			       const struct bna_tx_event_cbfn *tx_cbfn,
 			       struct bna_res_info *res_info, void *priv);
 void bna_tx_destroy(struct bna_tx *tx);
 void bna_tx_enable(struct bna_tx *tx);
@@ -490,7 +490,7 @@ void bna_rx_res_req(struct bna_rx_config
 		    struct bna_res_info *res_info);
 struct bna_rx *bna_rx_create(struct bna *bna, struct bnad *bnad,
 			       struct bna_rx_config *rx_cfg,
-			       struct bna_rx_event_cbfn *rx_cbfn,
+			       const struct bna_rx_event_cbfn *rx_cbfn,
 			       struct bna_res_info *res_info, void *priv);
 void bna_rx_destroy(struct bna_rx *rx);
 void bna_rx_enable(struct bna_rx *rx);
--- a/drivers/net/ethernet/brocade/bna/bnad.c	2011-09-16 13:35:52.237432520 -0700
+++ b/drivers/net/ethernet/brocade/bna/bnad.c	2011-09-16 13:35:54.597432628 -0700
@@ -1730,7 +1730,14 @@ bnad_setup_tx(struct bnad *bnad, u32 tx_
 	struct bna_intr_info *intr_info =
 			&res_info[BNA_TX_RES_INTR_T_TXCMPL].res_u.intr_info;
 	struct bna_tx_config *tx_config = &bnad->tx_config[tx_id];
-	struct bna_tx_event_cbfn tx_cbfn;
+	static const struct bna_tx_event_cbfn tx_cbfn = {
+		.tcb_setup_cbfn = bnad_cb_tcb_setup,
+		.tcb_destroy_cbfn = bnad_cb_tcb_destroy,
+		.tx_stall_cbfn = bnad_cb_tx_stall,
+		.tx_resume_cbfn = bnad_cb_tx_resume,
+		.tx_cleanup_cbfn = bnad_cb_tx_cleanup,
+	};
+
 	struct bna_tx *tx;
 	unsigned long flags;
 
@@ -1742,13 +1749,6 @@ bnad_setup_tx(struct bnad *bnad, u32 tx_
 	tx_config->tx_type = BNA_TX_T_REGULAR;
 	tx_config->coalescing_timeo = bnad->tx_coalescing_timeo;
 
-	/* Initialize the tx event handlers */
-	tx_cbfn.tcb_setup_cbfn = bnad_cb_tcb_setup;
-	tx_cbfn.tcb_destroy_cbfn = bnad_cb_tcb_destroy;
-	tx_cbfn.tx_stall_cbfn = bnad_cb_tx_stall;
-	tx_cbfn.tx_resume_cbfn = bnad_cb_tx_resume;
-	tx_cbfn.tx_cleanup_cbfn = bnad_cb_tx_cleanup;
-
 	/* Get BNA's resource requirement for one tx object */
 	spin_lock_irqsave(&bnad->bna_lock, flags);
 	bna_tx_res_req(bnad->num_txq_per_tx,
@@ -1893,7 +1893,14 @@ bnad_setup_rx(struct bnad *bnad, u32 rx_
 	struct bna_intr_info *intr_info =
 			&res_info[BNA_RX_RES_T_INTR].res_u.intr_info;
 	struct bna_rx_config *rx_config = &bnad->rx_config[rx_id];
-	struct bna_rx_event_cbfn rx_cbfn;
+	static const struct bna_rx_event_cbfn rx_cbfn = {
+		.rcb_setup_cbfn = bnad_cb_rcb_setup,
+		.rcb_destroy_cbfn = bnad_cb_rcb_destroy,
+		.ccb_setup_cbfn = bnad_cb_ccb_setup,
+		.ccb_destroy_cbfn = bnad_cb_ccb_destroy,
+		.rx_cleanup_cbfn = bnad_cb_rx_cleanup,
+		.rx_post_cbfn = bnad_cb_rx_post,
+	};
 	struct bna_rx *rx;
 	unsigned long flags;
 
@@ -1902,14 +1909,6 @@ bnad_setup_rx(struct bnad *bnad, u32 rx_
 	/* Initialize the Rx object configuration */
 	bnad_init_rx_config(bnad, rx_config);
 
-	/* Initialize the Rx event handlers */
-	rx_cbfn.rcb_setup_cbfn = bnad_cb_rcb_setup;
-	rx_cbfn.rcb_destroy_cbfn = bnad_cb_rcb_destroy;
-	rx_cbfn.ccb_setup_cbfn = bnad_cb_ccb_setup;
-	rx_cbfn.ccb_destroy_cbfn = bnad_cb_ccb_destroy;
-	rx_cbfn.rx_cleanup_cbfn = bnad_cb_rx_cleanup;
-	rx_cbfn.rx_post_cbfn = bnad_cb_rx_post;
-
 	/* Get BNA's resource requirement for one Rx object */
 	spin_lock_irqsave(&bnad->bna_lock, flags);
 	bna_rx_res_req(rx_config, res_info);
--- a/drivers/net/ethernet/brocade/bna/bna_tx_rx.c	2011-09-16 13:36:57.733435512 -0700
+++ b/drivers/net/ethernet/brocade/bna/bna_tx_rx.c	2011-09-16 13:37:07.885435977 -0700
@@ -2305,7 +2305,7 @@ bna_rx_res_req(struct bna_rx_config *q_c
 struct bna_rx *
 bna_rx_create(struct bna *bna, struct bnad *bnad,
 		struct bna_rx_config *rx_cfg,
-		struct bna_rx_event_cbfn *rx_cbfn,
+		const struct bna_rx_event_cbfn *rx_cbfn,
 		struct bna_res_info *res_info,
 		void *priv)
 {
@@ -3444,7 +3444,7 @@ bna_tx_res_req(int num_txq, int txq_dept
 struct bna_tx *
 bna_tx_create(struct bna *bna, struct bnad *bnad,
 		struct bna_tx_config *tx_cfg,
-		struct bna_tx_event_cbfn *tx_cbfn,
+		const struct bna_tx_event_cbfn *tx_cbfn,
 		struct bna_res_info *res_info, void *priv)
 {
 	struct bna_intr_info *intr_info;

^ permalink raw reply

* [PATCH net-next] vxge: make function table const
From: Stephen Hemminger @ 2011-09-16 21:10 UTC (permalink / raw)
  To: Jon Mason, David Miller; +Cc: netdev


All tables of function pointers should be const.
The pre-existing code has lots of needless indirection...

Inspired by similar change in PAX.
Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


---
 drivers/net/ethernet/neterion/vxge/vxge-config.c  |   11 +++++------
 drivers/net/ethernet/neterion/vxge/vxge-config.h  |    4 ++--
 drivers/net/ethernet/neterion/vxge/vxge-main.c    |   10 +++++++---
 drivers/net/ethernet/neterion/vxge/vxge-traffic.c |   12 ++++++------
 4 files changed, 20 insertions(+), 17 deletions(-)

--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c	2011-09-16 13:12:56.529369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c	2011-09-16 13:21:30.925393238 -0700
@@ -1342,9 +1342,7 @@ vxge_hw_device_initialize(
 	hldev->bar0 = attr->bar0;
 	hldev->pdev = attr->pdev;
 
-	hldev->uld_callbacks.link_up = attr->uld_callbacks.link_up;
-	hldev->uld_callbacks.link_down = attr->uld_callbacks.link_down;
-	hldev->uld_callbacks.crit_err = attr->uld_callbacks.crit_err;
+	hldev->uld_callbacks = attr->uld_callbacks;
 
 	__vxge_hw_device_pci_e_init(hldev);
 
@@ -2633,7 +2631,7 @@ __vxge_hw_mempool_create(struct __vxge_h
 			 u32 items_priv_size,
 			 u32 items_initial,
 			 u32 items_max,
-			 struct vxge_hw_mempool_cbs *mp_callback,
+			 const struct vxge_hw_mempool_cbs *mp_callback,
 			 void *userdata)
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
@@ -2817,7 +2815,9 @@ __vxge_hw_ring_create(struct __vxge_hw_v
 	struct vxge_hw_ring_config *config;
 	struct __vxge_hw_device *hldev;
 	u32 vp_id;
-	struct vxge_hw_mempool_cbs ring_mp_callback;
+	static const struct vxge_hw_mempool_cbs ring_mp_callback = {
+		.item_func_alloc = __vxge_hw_ring_mempool_item_alloc,
+	};
 
 	if ((vp == NULL) || (attr == NULL)) {
 		status = VXGE_HW_FAIL;
@@ -2872,7 +2872,6 @@ __vxge_hw_ring_create(struct __vxge_hw_v
 
 	/* calculate actual RxD block private size */
 	ring->rxdblock_priv_size = ring->rxd_priv_size * ring->rxds_per_block;
-	ring_mp_callback.item_func_alloc = __vxge_hw_ring_mempool_item_alloc;
 	ring->mempool = __vxge_hw_mempool_create(hldev,
 				VXGE_HW_BLOCK_SIZE,
 				VXGE_HW_BLOCK_SIZE,
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.h	2011-09-16 13:12:56.529369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.h	2011-09-16 13:21:30.925393238 -0700
@@ -740,7 +740,7 @@ struct __vxge_hw_device {
 	struct vxge_hw_device_config	config;
 	enum vxge_hw_device_link_state	link_state;
 
-	struct vxge_hw_uld_cbs		uld_callbacks;
+	const struct vxge_hw_uld_cbs	*uld_callbacks;
 
 	u32				host_type;
 	u32				func_id;
@@ -840,7 +840,7 @@ struct vxge_hw_device_hw_info {
 struct vxge_hw_device_attr {
 	void __iomem		*bar0;
 	struct pci_dev 		*pdev;
-	struct vxge_hw_uld_cbs	uld_callbacks;
+	const struct vxge_hw_uld_cbs *uld_callbacks;
 };
 
 #define VXGE_HW_DEVICE_LINK_STATE_SET(hldev, ls)	(hldev->link_state = ls)
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c	2011-09-16 13:12:56.529369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c	2011-09-16 13:21:30.925393238 -0700
@@ -4284,6 +4284,12 @@ static int __devinit is_sriov_initialize
 	return 0;
 }
 
+static const struct vxge_hw_uld_cbs vxge_callbacks = {
+	.link_up = vxge_callback_link_up,
+	.link_down = vxge_callback_link_down,
+	.crit_err = vxge_callback_crit_err,
+};
+
 /**
  * vxge_probe
  * @pdev : structure containing the PCI related information of the device.
@@ -4494,9 +4500,7 @@ vxge_probe(struct pci_dev *pdev, const s
 	}
 
 	/* Setting driver callbacks */
-	attr.uld_callbacks.link_up = vxge_callback_link_up;
-	attr.uld_callbacks.link_down = vxge_callback_link_down;
-	attr.uld_callbacks.crit_err = vxge_callback_crit_err;
+	attr.uld_callbacks = &vxge_callbacks;
 
 	status = vxge_hw_device_initialize(&hldev, &attr, device_config);
 	if (status != VXGE_HW_OK) {
--- a/drivers/net/ethernet/neterion/vxge/vxge-traffic.c	2011-09-16 13:12:56.533369674 -0700
+++ b/drivers/net/ethernet/neterion/vxge/vxge-traffic.c	2011-09-16 13:21:30.925393238 -0700
@@ -532,8 +532,8 @@ __vxge_hw_device_handle_error(struct __v
 	}
 
 	/* notify driver */
-	if (hldev->uld_callbacks.crit_err)
-		hldev->uld_callbacks.crit_err(
+	if (hldev->uld_callbacks->crit_err)
+		hldev->uld_callbacks->crit_err(
 			(struct __vxge_hw_device *)hldev,
 			type, vp_id);
 out:
@@ -560,8 +560,8 @@ __vxge_hw_device_handle_link_down_ind(st
 	hldev->link_state = VXGE_HW_LINK_DOWN;
 
 	/* notify driver */
-	if (hldev->uld_callbacks.link_down)
-		hldev->uld_callbacks.link_down(hldev);
+	if (hldev->uld_callbacks->link_down)
+		hldev->uld_callbacks->link_down(hldev);
 exit:
 	return VXGE_HW_OK;
 }
@@ -585,8 +585,8 @@ __vxge_hw_device_handle_link_up_ind(stru
 	hldev->link_state = VXGE_HW_LINK_UP;
 
 	/* notify driver */
-	if (hldev->uld_callbacks.link_up)
-		hldev->uld_callbacks.link_up(hldev);
+	if (hldev->uld_callbacks->link_up)
+		hldev->uld_callbacks->link_up(hldev);
 exit:
 	return VXGE_HW_OK;
 }

^ permalink raw reply

* Re: [PATCH] ipv6: Send ICMPv6 RSes only when RAs are accepted
From: David Miller @ 2011-09-16 21:15 UTC (permalink / raw)
  To: tore; +Cc: netdev
In-Reply-To: <201108291209.p7TC9KkD002967@wrath.fud.no>

From: Tore Anderson <tore@fud.no>
Date: Mon, 29 Aug 2011 14:08:33 +0200

> The change also makes "Hybrid Router" forwarding mode ("forwarding"
> sysctl set to 2) redundant, as the only thing that distinguished it from
> the standard Router mode (forwarding=1) was that RSes was being sent. It
> has therefore been removed.

You're not removing "accept_ra==2", it's still there in the test:

> -	if ((ifp->idev->cnf.forwarding == 0 ||
> -	     ifp->idev->cnf.forwarding == 2) &&
> +	if (((ifp->idev->cnf.accept_ra == 1 && !ifp->idev->cnf.forwarding) ||
> +	     ifp->idev->cnf.accept_ra == 2) &&

And it does provide it's own unique behavior compared to
"accept_ra==1".

^ permalink raw reply

* Re: [PATCH] sctp: deal with multiple COOKIE_ECHO chunks
From: David Miller @ 2011-09-16 21:17 UTC (permalink / raw)
  To: makc; +Cc: linux-sctp, netdev, vladislav.yasevich
In-Reply-To: <20110830072010.94AE98132707@regina.usersys.redhat.com>

From: Max Matveev <makc@redhat.com>
Date: Tue, 30 Aug 2011 17:02:24 +1000

> Attempt to reduce the number of IP packets emitted in response to single
> SCTP packet (2e3216cd) introduced a complication - if a packet contains
> two COOKIE_ECHO chunks and nothing else then SCTP state machine corks the
> socket while processing first COOKIE_ECHO and then loses the association
> and forgets to uncork the socket. To deal with the issue add new SCTP
> command which can be used to set association explictly. Use this new
> command when processing second COOKIE_ECHO chunk to restore the context
> for SCTP state machine.
> 
> Signed-off-by: Max Matveev <makc@redhat.com>

Applied, but there were a ton of whitespace errors that GIT complained
about and I had to fix up.

^ permalink raw reply

* [PATCH net-next] ixgb: relax stack usage of 768 Byte
From: Hagen Paul Pfeifer @ 2011-09-16 21:34 UTC (permalink / raw)
  To: netdev; +Cc: Hagen Paul Pfeifer, Jeff Kirsher

ixgb_set_multi() will push (128 * 6) byte on the stack to set the
multicast filter. Fix this by allocate the scratch buffer on the heap.

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgb/ixgb_main.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index c8b9c90..4d23007 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -1095,8 +1095,10 @@ ixgb_set_multi(struct net_device *netdev)
 		rctl |= IXGB_RCTL_MPE;
 		IXGB_WRITE_REG(hw, RCTL, rctl);
 	} else {
-		u8 mta[IXGB_MAX_NUM_MULTICAST_ADDRESSES *
-			    IXGB_ETH_LENGTH_OF_ADDRESS];
+		u8 *mta = kmalloc(IXGB_MAX_NUM_MULTICAST_ADDRESSES *
+				IXGB_ETH_LENGTH_OF_ADDRESS, GFP_ATOMIC);
+		if (!mta)
+			return;
 
 		IXGB_WRITE_REG(hw, RCTL, rctl);
 
@@ -1106,6 +1108,8 @@ ixgb_set_multi(struct net_device *netdev)
 			       ha->addr, IXGB_ETH_LENGTH_OF_ADDRESS);
 
 		ixgb_mc_addr_list_update(hw, mta, netdev_mc_count(netdev), 0);
+
+		kfree(mta);
 	}
 
 	if (netdev->features & NETIF_F_HW_VLAN_RX)
-- 
1.7.5.4

^ permalink raw reply related

* Re: [PATCH] ipv6: Send ICMPv6 RSes only when RAs are accepted
From: David Miller @ 2011-09-16 21:49 UTC (permalink / raw)
  To: tore; +Cc: netdev
In-Reply-To: <4E73C2E5.2050901@fud.no>

From: Tore Anderson <tore@fud.no>
Date: Fri, 16 Sep 2011 23:43:01 +0200

> * David Miller
> 
>> From: Tore Anderson <tore@fud.no>
>> Date: Mon, 29 Aug 2011 14:08:33 +0200
>> 
>>> The change also makes "Hybrid Router" forwarding mode ("forwarding"
>>> sysctl set to 2) redundant, as the only thing that distinguished it from
>>> the standard Router mode (forwarding=1) was that RSes was being sent. It
>>> has therefore been removed.
>> 
>> You're not removing "accept_ra==2", it's still there in the test:
>> 
>>> -	if ((ifp->idev->cnf.forwarding == 0 ||
>>> -	     ifp->idev->cnf.forwarding == 2) &&
>>> +	if (((ifp->idev->cnf.accept_ra == 1 && !ifp->idev->cnf.forwarding) ||
>>> +	     ifp->idev->cnf.accept_ra == 2) &&
>> 
>> And it does provide it's own unique behavior compared to
>> "accept_ra==1".
> 
> Hi David,
> 
> I'm not removing accept_ra==2, no, only forwarding==2. Or, more
> precisely, I'm only removing the *documentation* for forwarding==2;
> forwarding==2 will still work, but there's no difference from
> forwarding==1 any longer.

Ok, please make this more clear in your commit message.

Thank you.

^ permalink raw reply

* Re: [PATCH] ipv6: Send ICMPv6 RSes only when RAs are accepted
From: Tore Anderson @ 2011-09-16 21:43 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20110916.171503.42153974977438913.davem@davemloft.net>

* David Miller

> From: Tore Anderson <tore@fud.no>
> Date: Mon, 29 Aug 2011 14:08:33 +0200
> 
>> The change also makes "Hybrid Router" forwarding mode ("forwarding"
>> sysctl set to 2) redundant, as the only thing that distinguished it from
>> the standard Router mode (forwarding=1) was that RSes was being sent. It
>> has therefore been removed.
> 
> You're not removing "accept_ra==2", it's still there in the test:
> 
>> -	if ((ifp->idev->cnf.forwarding == 0 ||
>> -	     ifp->idev->cnf.forwarding == 2) &&
>> +	if (((ifp->idev->cnf.accept_ra == 1 && !ifp->idev->cnf.forwarding) ||
>> +	     ifp->idev->cnf.accept_ra == 2) &&
> 
> And it does provide it's own unique behavior compared to
> "accept_ra==1".

Hi David,

I'm not removing accept_ra==2, no, only forwarding==2. Or, more
precisely, I'm only removing the *documentation* for forwarding==2;
forwarding==2 will still work, but there's no difference from
forwarding==1 any longer.

-- 
Tore Anderson

^ permalink raw reply

* Re: [PATCH] ipv6: Send ICMPv6 RSes only when RAs are accepted
From: Tore Anderson @ 2011-09-16 22:07 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20110916.174900.961553137813655280.davem@davemloft.net>

* David Miller

>> I'm not removing accept_ra==2, no, only forwarding==2. Or, more
>> precisely, I'm only removing the *documentation* for forwarding==2;
>> forwarding==2 will still work, but there's no difference from
>> forwarding==1 any longer.
> 
> Ok, please make this more clear in your commit message.

I actually did improve the commit message in this regard when I re-sent
the patch, see <http://patchwork.ozlabs.org/patch/113625/>. Is that one
good enough?

-- 
Tore Anderson

^ permalink raw reply

* Re: [PATCH] caif: fix a potential NULL dereference
From: David Miller @ 2011-09-16 22:56 UTC (permalink / raw)
  To: eric.dumazet; +Cc: sjurbren, netdev
In-Reply-To: <1314965963.2573.23.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 02 Sep 2011 14:19:23 +0200

> Commit bd30ce4bc0b7 (caif: Use RCU instead of spin-lock in caif_dev.c)
> added a potential NULL dereference in case alloc_percpu() fails.
> 
> caif_device_alloc() can also use GFP_KERNEL instead of GFP_ATOMIC.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Sjur Brændeland <sjur.brandeland@stericsson.com>

Applied.

^ permalink raw reply

* Re: [PATCH 1/2] net: Align AF-specific flowi structs to long
From: David Miller @ 2011-09-16 22:57 UTC (permalink / raw)
  To: david.ward; +Cc: netdev, ja
In-Reply-To: <1315141641-3120-2-git-send-email-david.ward@ll.mit.edu>

From: David Ward <david.ward@ll.mit.edu>
Date: Sun, 4 Sep 2011 09:07:20 -0400

> AF-specific flowi structs are now passed to flow_key_compare, which must
> also be aligned to a long.
> 
> Signed-off-by: David Ward <david.ward@ll.mit.edu>

Applied.

^ permalink raw reply

* Re: [PATCH 2/2] net: Handle different key sizes between address families in flow cache
From: David Miller @ 2011-09-16 22:57 UTC (permalink / raw)
  To: david.ward; +Cc: netdev, ja
In-Reply-To: <1315141641-3120-3-git-send-email-david.ward@ll.mit.edu>

From: David Ward <david.ward@ll.mit.edu>
Date: Sun, 4 Sep 2011 09:07:21 -0400

> With the conversion of struct flowi to a union of AF-specific structs, some
> operations on the flow cache need to account for the exact size of the key.
> 
> Signed-off-by: David Ward <david.ward@ll.mit.edu>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] can-gw: add netlink based CAN routing
From: David Miller @ 2011-09-16 22:55 UTC (permalink / raw)
  To: socketcan; +Cc: netdev, sojkam1, pisa, hanzalek, oliver.hartkopp
In-Reply-To: <4E5F955B.8030806@hartkopp.net>

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: Thu, 01 Sep 2011 16:23:23 +0200

> This patch adds a CAN Gateway/Router to route (and modify) CAN frames.
> 
> It is based on the PF_CAN core infrastructure for msg filtering and msg
> sending and can optionally modify routed CAN frames on the fly.
> CAN frames can *only* be routed between CAN network interfaces (one hop).
> They can be modified with AND/OR/XOR/SET operations as configured by the
> netlink configuration interface known e.g. from iptables. From the netlink
> view this can-gw implements RTM_{NEW|DEL|GET}ROUTE for PF_CAN.
> 
> The CAN specific userspace tool to manage CAN routing entries can be found in
> the CAN utils http://svn.berlios.de/wsvn/socketcan/trunk/can-utils/cangw.c
> at the SocketCAN SVN on BerliOS.
> 
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

Applied.

^ permalink raw reply

* Re: [PATCH] ipv4: Fix fib_info->fib_metrics leak
From: David Miller @ 2011-09-16 22:58 UTC (permalink / raw)
  To: zheng.z.yan; +Cc: netdev, laijs
In-Reply-To: <4E646B14.1020801@intel.com>

From: "Yan, Zheng" <zheng.z.yan@intel.com>
Date: Mon, 05 Sep 2011 14:24:20 +0800

> Commit 4670994d(net,rcu: convert call_rcu(fc_rport_free_rcu) to
> kfree_rcu()) introduced a memory leak. This patch reverts it.
> 
> Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] ixgb: relax stack usage of 768 Byte
From: Jeff Kirsher @ 2011-09-16 23:08 UTC (permalink / raw)
  To: Hagen Paul Pfeifer; +Cc: netdev@vger.kernel.org
In-Reply-To: <1316208897-4557-1-git-send-email-hagen@jauu.net>

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

On Fri, 2011-09-16 at 14:34 -0700, Hagen Paul Pfeifer wrote:
> ixgb_set_multi() will push (128 * 6) byte on the stack to set the
> multicast filter. Fix this by allocate the scratch buffer on the heap.
> 
> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
>  drivers/net/ethernet/intel/ixgb/ixgb_main.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-) 

Thanks Hagen! I have added the patch to my queue of ixgbe patches.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [PATCH] ipv6: Send ICMPv6 RSes only when RAs are accepted
From: David Miller @ 2011-09-16 23:15 UTC (permalink / raw)
  To: tore; +Cc: netdev
In-Reply-To: <4E73C8B1.70404@fud.no>

From: Tore Anderson <tore@fud.no>
Date: Sat, 17 Sep 2011 00:07:45 +0200

> * David Miller
> 
>>> I'm not removing accept_ra==2, no, only forwarding==2. Or, more
>>> precisely, I'm only removing the *documentation* for forwarding==2;
>>> forwarding==2 will still work, but there's no difference from
>>> forwarding==1 any longer.
>> 
>> Ok, please make this more clear in your commit message.
> 
> I actually did improve the commit message in this regard when I re-sent
> the patch, see <http://patchwork.ozlabs.org/patch/113625/>. Is that one
> good enough?

Looks good, applied, thanks!

^ permalink raw reply

* Re: [PATCH] IRDA: Fix global type conflicts in net/irda/irsysctl.c v2
From: David Miller @ 2011-09-16 23:17 UTC (permalink / raw)
  To: andi; +Cc: samuel, netdev, ak
In-Reply-To: <1316200190-2320-1-git-send-email-andi@firstfloor.org>

From: Andi Kleen <andi@firstfloor.org>
Date: Fri, 16 Sep 2011 12:09:50 -0700

> From: Andi Kleen <ak@linux.intel.com>
> 
> The externs here didn't agree with the declarations in qos.c.
> 
> Better would be probably to move this into a header, but since it's
> common practice to have naked externs with sysctls I left it for now.
> 
> Cc: samuel@sortiz.org
> Signed-off-by: Andi Kleen <ak@linux.intel.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] pcnet32: constify function table
From: David Miller @ 2011-09-16 23:20 UTC (permalink / raw)
  To: shemminger; +Cc: pcnet32, netdev
In-Reply-To: <20110916140626.2648c477@nehalam.linuxnetplumber.net>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 16 Sep 2011 14:06:26 -0700

> Function tables need to be const to prevent malicious use.
> 
> This is compile tested only.
> Gleaned from PAX.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.

^ permalink raw reply

* Re: [PATCH] wan: make LAPB callbacks const
From: David Miller @ 2011-09-16 23:20 UTC (permalink / raw)
  To: shemminger; +Cc: khc, netdev
In-Reply-To: <20110916140429.4a144301@nehalam.linuxnetplumber.net>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 16 Sep 2011 14:04:29 -0700

> This is compile tested only.
> Suggested by dumpster diving in PAX.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] vxge: make function table const
From: David Miller @ 2011-09-16 23:20 UTC (permalink / raw)
  To: shemminger; +Cc: jdmason, netdev
In-Reply-To: <20110916141001.2d4ca61d@nehalam.linuxnetplumber.net>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 16 Sep 2011 14:10:01 -0700

> 
> All tables of function pointers should be const.
> The pre-existing code has lots of needless indirection...
> 
> Inspired by similar change in PAX.
> Compile tested only.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.

^ permalink raw reply

* Re: [PATCH] can: ti_hecc: include linux/io.h
From: David Miller @ 2011-09-16 23:21 UTC (permalink / raw)
  To: wg; +Cc: zonque, linux-kernel, netdev
In-Reply-To: <4E73A123.1040801@grandegger.com>

From: Wolfgang Grandegger <wg@grandegger.com>
Date: Fri, 16 Sep 2011 21:18:59 +0200

> On 09/16/2011 07:57 PM, Daniel Mack wrote:
>> This fixes a build breakage for OMAP3 boards.
>> 
>> Signed-off-by: Daniel Mack <zonque@gmail.com>
>> Cc: Wolfgang Grandegger <wg@grandegger.com>
>> Cc: netdev@vger.kernel.org
> 
> Acked-by: Wolfgang Grandegger <wg@grandegger.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] bna: make function tables cont
From: David Miller @ 2011-09-16 23:20 UTC (permalink / raw)
  To: shemminger; +Cc: rmody, netdev
In-Reply-To: <20110916140951.6318785d@nehalam.linuxnetplumber.net>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 16 Sep 2011 14:09:51 -0700

> To prevent malicious usage, all tables of pointers must be const.
> 
> Compile tested only.
> Gleaned for PAX.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 0/4] ethtool: Fixes for RX NFC API
From: David Miller @ 2011-09-16 23:25 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev, alexander.h.duyck, sebastian.poehn, santwona.behera
In-Reply-To: <1315352693.2788.20.camel@bwh-desktop>

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 07 Sep 2011 00:44:53 +0100

> This series fixes some minor flaws in the documentation and the API itself.

All applied, thanks Ben.

^ permalink raw reply

* Re: [PATCH -next v2] unix stream: Fix use-after-free crashes
From: David Miller @ 2011-09-16 23:35 UTC (permalink / raw)
  To: eric.dumazet
  Cc: zheng.z.yan, tim.c.chen, zheng.z.yan, netdev, sfr, jirislaby,
	sedat.dilek, alex.shi
In-Reply-To: <1315364126.3400.64.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 07 Sep 2011 04:55:26 +0200

> Please David just revert 0856a304091b33a8e

Done.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox