patch-2.2.17 linux/drivers/net/n2.c

Next file: linux/drivers/net/pc300.c
Previous file: linux/drivers/net/mace.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.16/drivers/net/n2.c linux/drivers/net/n2.c
@@ -122,23 +122,23 @@
 
 
 
-#define sca_reg(reg, card) (0x8000 | card->io | \
+#define sca_reg(reg, card) (0x8000 | (card)->io | \
 			    ((reg)&0x0F) | (((reg)&0xF0) << 6))
-#define sca_in(reg, card)		readb(sca_reg(reg, card))
-#define sca_out(value, reg, card)	writeb(value, sca_reg(reg, card))
-#define sca_inw(reg, card)		readw(sca_reg(reg, card))
-#define sca_outw(value, reg, card)	writew(value, sca_reg(reg, card))
-
-#define port_to_card(port)		(port->card)
-#define log_node(port)			(port->log_node)
-#define phy_node(port)			(port->phy_node)
+#define sca_in(reg, card)		inb(sca_reg(reg, card))
+#define sca_out(value, reg, card)	outb(value, sca_reg(reg, card))
+#define sca_inw(reg, card)		inw(sca_reg(reg, card))
+#define sca_outw(value, reg, card)	outw(value, sca_reg(reg, card))
+
+#define port_to_card(port)		((port)->card)
+#define log_node(port)			((port)->log_node)
+#define phy_node(port)			((port)->phy_node)
 #define winsize(card)			(USE_WINDOWSIZE)
-#define winbase(card)      	     	(card->winbase)
-#define get_port(card, port)		(card->ports[port].valid ? \
-					 &card->ports[port] : NULL)
+#define winbase(card)      	     	((card)->winbase)
+#define get_port(card, port)		((card)->ports[port].valid ? \
+					 &(card)->ports[port] : NULL)
 
 
-static __inline__ u8 get_page(card_t *card)
+static __inline__ u8 sca_get_page(card_t *card)
 {
 	return inb(card->io+N2_PSR) & PSR_PAGEBITS;
 }
@@ -163,9 +163,9 @@
 	u8 mcr = inb(io+N2_MCR);
   
 	if (clock == LINE_EXT_CLOCK) /* External clock */
-		mcr |= port->phy_node ? CLOCK_OUT_PORT1 : CLOCK_OUT_PORT0;
-	else
 		mcr &= port->phy_node ? ~CLOCK_OUT_PORT1 : ~CLOCK_OUT_PORT0;
+	else
+		mcr |= port->phy_node ? CLOCK_OUT_PORT1 : CLOCK_OUT_PORT0;
 
 	outb(mcr, io+N2_MCR);
 	port->clkmode = clock;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)