Commit 5dcf41a8 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'net-sunhme-cleanups-and-logging-improvements'

Sean Anderson says:

====================
net: sunhme: Cleanups and logging improvements

This series is a continuation of [1] with a focus on logging improvements (in
the style of commit b11e5f6a ("net: sunhme: output link status with a single
print.")). I have included several of Rolf's patches in the series where
appropriate (with slight modifications). After this series is applied, many more
messages from this driver will come with driver/device information.
Additionally, most messages (especially debug messages) have been condensed onto
one line (as KERN_CONT messages get split).

[1] https://lore.kernel.org/netdev/4686583.GXAFRqVoOG@eto.sf-tec.de/
====================

Link: https://lore.kernel.org/r/20220924015339.1816744-1-seanga2@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents ebb410a0 77ceb373
...@@ -19511,6 +19511,11 @@ L: netdev@vger.kernel.org ...@@ -19511,6 +19511,11 @@ L: netdev@vger.kernel.org
S: Maintained S: Maintained
F: drivers/net/ethernet/dlink/sundance.c F: drivers/net/ethernet/dlink/sundance.c
SUN HAPPY MEAL ETHERNET DRIVER
M: Sean Anderson <seanga2@gmail.com>
S: Maintained
F: drivers/net/ethernet/sun/sunhme.*
SUNPLUS ETHERNET DRIVER SUNPLUS ETHERNET DRIVER
M: Wells Lu <wellslutw@gmail.com> M: Wells Lu <wellslutw@gmail.com>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
......
...@@ -61,15 +61,8 @@ ...@@ -61,15 +61,8 @@
#include "sunhme.h" #include "sunhme.h"
#define DRV_NAME "sunhme" #define DRV_NAME "sunhme"
#define DRV_VERSION "3.10"
#define DRV_RELDATE "August 26, 2008"
#define DRV_AUTHOR "David S. Miller (davem@davemloft.net)"
static char version[] = MODULE_AUTHOR("David S. Miller (davem@davemloft.net)");
DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n";
MODULE_VERSION(DRV_VERSION);
MODULE_AUTHOR(DRV_AUTHOR);
MODULE_DESCRIPTION("Sun HappyMealEthernet(HME) 10/100baseT ethernet driver"); MODULE_DESCRIPTION("Sun HappyMealEthernet(HME) 10/100baseT ethernet driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -87,13 +80,17 @@ static struct quattro *qfe_sbus_list; ...@@ -87,13 +80,17 @@ static struct quattro *qfe_sbus_list;
static struct quattro *qfe_pci_list; static struct quattro *qfe_pci_list;
#endif #endif
#undef HMEDEBUG #define hme_debug(fmt, ...) pr_debug("%s: " fmt, __func__, ##__VA_ARGS__)
#undef SXDEBUG #define HMD hme_debug
#undef RXDEBUG
#undef TXDEBUG /* "Auto Switch Debug" aka phy debug */
#undef TXLOGGING #if 1
#define ASD hme_debug
#else
#define ASD(...)
#endif
#ifdef TXLOGGING #if 0
struct hme_tx_logent { struct hme_tx_logent {
unsigned int tstamp; unsigned int tstamp;
int tx_new, tx_old; int tx_new, tx_old;
...@@ -128,46 +125,16 @@ static __inline__ void tx_dump_log(void) ...@@ -128,46 +125,16 @@ static __inline__ void tx_dump_log(void)
this = txlog_cur_entry; this = txlog_cur_entry;
for (i = 0; i < TX_LOG_LEN; i++) { for (i = 0; i < TX_LOG_LEN; i++) {
printk("TXLOG[%d]: j[%08x] tx[N(%d)O(%d)] action[%08x] stat[%08x]\n", i, pr_err("TXLOG[%d]: j[%08x] tx[N(%d)O(%d)] action[%08x] stat[%08x]\n", i,
tx_log[this].tstamp, tx_log[this].tstamp,
tx_log[this].tx_new, tx_log[this].tx_old, tx_log[this].tx_new, tx_log[this].tx_old,
tx_log[this].action, tx_log[this].status); tx_log[this].action, tx_log[this].status);
this = (this + 1) & (TX_LOG_LEN - 1); this = (this + 1) & (TX_LOG_LEN - 1);
} }
} }
static __inline__ void tx_dump_ring(struct happy_meal *hp)
{
struct hmeal_init_block *hb = hp->happy_block;
struct happy_meal_txd *tp = &hb->happy_meal_txd[0];
int i;
for (i = 0; i < TX_RING_SIZE; i+=4) {
printk("TXD[%d..%d]: [%08x:%08x] [%08x:%08x] [%08x:%08x] [%08x:%08x]\n",
i, i + 4,
le32_to_cpu(tp[i].tx_flags), le32_to_cpu(tp[i].tx_addr),
le32_to_cpu(tp[i + 1].tx_flags), le32_to_cpu(tp[i + 1].tx_addr),
le32_to_cpu(tp[i + 2].tx_flags), le32_to_cpu(tp[i + 2].tx_addr),
le32_to_cpu(tp[i + 3].tx_flags), le32_to_cpu(tp[i + 3].tx_addr));
}
}
#else
#define tx_add_log(hp, a, s) do { } while(0)
#define tx_dump_log() do { } while(0)
#define tx_dump_ring(hp) do { } while(0)
#endif
#ifdef HMEDEBUG
#define HMD(x) printk x
#else #else
#define HMD(x) #define tx_add_log(hp, a, s)
#endif #define tx_dump_log()
/* #define AUTO_SWITCH_DEBUG */
#ifdef AUTO_SWITCH_DEBUG
#define ASD(x) printk x
#else
#define ASD(x)
#endif #endif
#define DEFAULT_IPG0 16 /* For lance-mode only */ #define DEFAULT_IPG0 16 /* For lance-mode only */
...@@ -343,8 +310,6 @@ static int happy_meal_bb_read(struct happy_meal *hp, ...@@ -343,8 +310,6 @@ static int happy_meal_bb_read(struct happy_meal *hp,
int retval = 0; int retval = 0;
int i; int i;
ASD(("happy_meal_bb_read: reg=%d ", reg));
/* Enable the MIF BitBang outputs. */ /* Enable the MIF BitBang outputs. */
hme_write32(hp, tregs + TCVR_BBOENAB, 1); hme_write32(hp, tregs + TCVR_BBOENAB, 1);
...@@ -378,7 +343,7 @@ static int happy_meal_bb_read(struct happy_meal *hp, ...@@ -378,7 +343,7 @@ static int happy_meal_bb_read(struct happy_meal *hp,
(void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal));
(void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal));
(void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal));
ASD(("value=%x\n", retval)); ASD("reg=%d value=%x\n", reg, retval);
return retval; return retval;
} }
...@@ -389,7 +354,7 @@ static void happy_meal_bb_write(struct happy_meal *hp, ...@@ -389,7 +354,7 @@ static void happy_meal_bb_write(struct happy_meal *hp,
u32 tmp; u32 tmp;
int i; int i;
ASD(("happy_meal_bb_write: reg=%d value=%x\n", reg, value)); ASD("reg=%d value=%x\n", reg, value);
/* Enable the MIF BitBang outputs. */ /* Enable the MIF BitBang outputs. */
hme_write32(hp, tregs + TCVR_BBOENAB, 1); hme_write32(hp, tregs + TCVR_BBOENAB, 1);
...@@ -433,14 +398,13 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, ...@@ -433,14 +398,13 @@ static int happy_meal_tcvr_read(struct happy_meal *hp,
int tries = TCVR_READ_TRIES; int tries = TCVR_READ_TRIES;
int retval; int retval;
ASD(("happy_meal_tcvr_read: reg=0x%02x ", reg));
if (hp->tcvr_type == none) { if (hp->tcvr_type == none) {
ASD(("no transceiver, value=TCVR_FAILURE\n")); ASD("no transceiver, value=TCVR_FAILURE\n");
return TCVR_FAILURE; return TCVR_FAILURE;
} }
if (!(hp->happy_flags & HFLAG_FENABLE)) { if (!(hp->happy_flags & HFLAG_FENABLE)) {
ASD(("doing bit bang\n")); ASD("doing bit bang\n");
return happy_meal_bb_read(hp, tregs, reg); return happy_meal_bb_read(hp, tregs, reg);
} }
...@@ -449,11 +413,11 @@ static int happy_meal_tcvr_read(struct happy_meal *hp, ...@@ -449,11 +413,11 @@ static int happy_meal_tcvr_read(struct happy_meal *hp,
while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries) while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries)
udelay(20); udelay(20);
if (!tries) { if (!tries) {
printk(KERN_ERR "happy meal: Aieee, transceiver MIF read bolixed\n"); netdev_err(hp->dev, "Aieee, transceiver MIF read bolixed\n");
return TCVR_FAILURE; return TCVR_FAILURE;
} }
retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff;
ASD(("value=%04x\n", retval)); ASD("reg=0x%02x value=%04x\n", reg, retval);
return retval; return retval;
} }
...@@ -465,7 +429,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, ...@@ -465,7 +429,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp,
{ {
int tries = TCVR_WRITE_TRIES; int tries = TCVR_WRITE_TRIES;
ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value)); ASD("reg=0x%02x value=%04x\n", reg, value);
/* Welcome to Sun Microsystems, can I take your order please? */ /* Welcome to Sun Microsystems, can I take your order please? */
if (!(hp->happy_flags & HFLAG_FENABLE)) { if (!(hp->happy_flags & HFLAG_FENABLE)) {
...@@ -482,7 +446,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp, ...@@ -482,7 +446,7 @@ static void happy_meal_tcvr_write(struct happy_meal *hp,
/* Anything else? */ /* Anything else? */
if (!tries) if (!tries)
printk(KERN_ERR "happy meal: Aieee, transceiver MIF write bolixed\n"); netdev_err(hp->dev, "Aieee, transceiver MIF write bolixed\n");
/* Fifty-two cents is your change, have a nice day. */ /* Fifty-two cents is your change, have a nice day. */
} }
...@@ -660,8 +624,8 @@ static void happy_meal_timer(struct timer_list *t) ...@@ -660,8 +624,8 @@ static void happy_meal_timer(struct timer_list *t)
/* Enter force mode. */ /* Enter force mode. */
do_force_mode: do_force_mode:
hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
printk(KERN_NOTICE "%s: Auto-Negotiation unsuccessful, trying force link mode\n", netdev_notice(hp->dev,
hp->dev->name); "Auto-Negotiation unsuccessful, trying force link mode\n");
hp->sw_bmcr = BMCR_SPEED100; hp->sw_bmcr = BMCR_SPEED100;
happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
...@@ -720,8 +684,8 @@ static void happy_meal_timer(struct timer_list *t) ...@@ -720,8 +684,8 @@ static void happy_meal_timer(struct timer_list *t)
restart_timer = 0; restart_timer = 0;
} else { } else {
if (hp->timer_ticks >= 10) { if (hp->timer_ticks >= 10) {
printk(KERN_NOTICE "%s: Auto negotiation successful, link still " netdev_notice(hp->dev,
"not completely up.\n", hp->dev->name); "Auto negotiation successful, link still not completely up.\n");
hp->timer_ticks = 0; hp->timer_ticks = 0;
restart_timer = 1; restart_timer = 1;
} else { } else {
...@@ -776,14 +740,14 @@ static void happy_meal_timer(struct timer_list *t) ...@@ -776,14 +740,14 @@ static void happy_meal_timer(struct timer_list *t)
*/ */
/* Let the user know... */ /* Let the user know... */
printk(KERN_NOTICE "%s: Link down, cable problem?\n", netdev_notice(hp->dev,
hp->dev->name); "Link down, cable problem?\n");
ret = happy_meal_init(hp); ret = happy_meal_init(hp);
if (ret) { if (ret) {
/* ho hum... */ /* ho hum... */
printk(KERN_ERR "%s: Error, cannot re-init the " netdev_err(hp->dev,
"Happy Meal.\n", hp->dev->name); "Error, cannot re-init the Happy Meal.\n");
} }
goto out; goto out;
} }
...@@ -805,8 +769,8 @@ static void happy_meal_timer(struct timer_list *t) ...@@ -805,8 +769,8 @@ static void happy_meal_timer(struct timer_list *t)
case asleep: case asleep:
default: default:
/* Can't happens.... */ /* Can't happens.... */
printk(KERN_ERR "%s: Aieee, link timer is asleep but we got one anyways!\n", netdev_err(hp->dev,
hp->dev->name); "Aieee, link timer is asleep but we got one anyways!\n");
restart_timer = 0; restart_timer = 0;
hp->timer_ticks = 0; hp->timer_ticks = 0;
hp->timer_state = asleep; /* foo on you */ hp->timer_state = asleep; /* foo on you */
...@@ -830,7 +794,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) ...@@ -830,7 +794,7 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs)
{ {
int tries = TX_RESET_TRIES; int tries = TX_RESET_TRIES;
HMD(("happy_meal_tx_reset: reset, ")); HMD("reset...\n");
/* Would you like to try our SMCC Delux? */ /* Would you like to try our SMCC Delux? */
hme_write32(hp, bregs + BMAC_TXSWRESET, 0); hme_write32(hp, bregs + BMAC_TXSWRESET, 0);
...@@ -839,10 +803,10 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) ...@@ -839,10 +803,10 @@ static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs)
/* Lettuce, tomato, buggy hardware (no extra charge)? */ /* Lettuce, tomato, buggy hardware (no extra charge)? */
if (!tries) if (!tries)
printk(KERN_ERR "happy meal: Transceiver BigMac ATTACK!"); netdev_err(hp->dev, "Transceiver BigMac ATTACK!");
/* Take care. */ /* Take care. */
HMD(("done\n")); HMD("done\n");
} }
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
...@@ -850,7 +814,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) ...@@ -850,7 +814,7 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs)
{ {
int tries = RX_RESET_TRIES; int tries = RX_RESET_TRIES;
HMD(("happy_meal_rx_reset: reset, ")); HMD("reset...\n");
/* We have a special on GNU/Viking hardware bugs today. */ /* We have a special on GNU/Viking hardware bugs today. */
hme_write32(hp, bregs + BMAC_RXSWRESET, 0); hme_write32(hp, bregs + BMAC_RXSWRESET, 0);
...@@ -859,10 +823,10 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) ...@@ -859,10 +823,10 @@ static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs)
/* Will that be all? */ /* Will that be all? */
if (!tries) if (!tries)
printk(KERN_ERR "happy meal: Receiver BigMac ATTACK!"); netdev_err(hp->dev, "Receiver BigMac ATTACK!\n");
/* Don't forget your vik_1137125_wa. Have a nice day. */ /* Don't forget your vik_1137125_wa. Have a nice day. */
HMD(("done\n")); HMD("done\n");
} }
#define STOP_TRIES 16 #define STOP_TRIES 16
...@@ -872,7 +836,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) ...@@ -872,7 +836,7 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs)
{ {
int tries = STOP_TRIES; int tries = STOP_TRIES;
HMD(("happy_meal_stop: reset, ")); HMD("reset...\n");
/* We're consolidating our STB products, it's your lucky day. */ /* We're consolidating our STB products, it's your lucky day. */
hme_write32(hp, gregs + GREG_SWRESET, GREG_RESET_ALL); hme_write32(hp, gregs + GREG_SWRESET, GREG_RESET_ALL);
...@@ -881,10 +845,10 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) ...@@ -881,10 +845,10 @@ static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs)
/* Come back next week when we are "Sun Microelectronics". */ /* Come back next week when we are "Sun Microelectronics". */
if (!tries) if (!tries)
printk(KERN_ERR "happy meal: Fry guys."); netdev_err(hp->dev, "Fry guys.\n");
/* Remember: "Different name, same old buggy as shit hardware." */ /* Remember: "Different name, same old buggy as shit hardware." */
HMD(("done\n")); HMD("done\n");
} }
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
...@@ -913,21 +877,18 @@ static void happy_meal_get_counters(struct happy_meal *hp, void __iomem *bregs) ...@@ -913,21 +877,18 @@ static void happy_meal_get_counters(struct happy_meal *hp, void __iomem *bregs)
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs) static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs)
{ {
ASD(("happy_meal_poll_stop: "));
/* If polling disabled or not polling already, nothing to do. */ /* If polling disabled or not polling already, nothing to do. */
if ((hp->happy_flags & (HFLAG_POLLENABLE | HFLAG_POLL)) != if ((hp->happy_flags & (HFLAG_POLLENABLE | HFLAG_POLL)) !=
(HFLAG_POLLENABLE | HFLAG_POLL)) { (HFLAG_POLLENABLE | HFLAG_POLL)) {
HMD(("not polling, return\n")); ASD("not polling, return\n");
return; return;
} }
/* Shut up the MIF. */ /* Shut up the MIF. */
ASD(("were polling, mif ints off, ")); ASD("were polling, mif ints off, polling off\n");
hme_write32(hp, tregs + TCVR_IMASK, 0xffff); hme_write32(hp, tregs + TCVR_IMASK, 0xffff);
/* Turn off polling. */ /* Turn off polling. */
ASD(("polling off, "));
hme_write32(hp, tregs + TCVR_CFG, hme_write32(hp, tregs + TCVR_CFG,
hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PENABLE)); hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PENABLE));
...@@ -936,7 +897,7 @@ static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs) ...@@ -936,7 +897,7 @@ static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs)
/* Let the bits set. */ /* Let the bits set. */
udelay(200); udelay(200);
ASD(("done\n")); ASD("done\n");
} }
/* Only Sun can take such nice parts and fuck up the programming interface /* Only Sun can take such nice parts and fuck up the programming interface
...@@ -952,44 +913,40 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) ...@@ -952,44 +913,40 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs)
int result, tries = TCVR_RESET_TRIES; int result, tries = TCVR_RESET_TRIES;
tconfig = hme_read32(hp, tregs + TCVR_CFG); tconfig = hme_read32(hp, tregs + TCVR_CFG);
ASD(("happy_meal_tcvr_reset: tcfg<%08lx> ", tconfig)); ASD("tcfg=%08x\n", tconfig);
if (hp->tcvr_type == external) { if (hp->tcvr_type == external) {
ASD(("external<"));
hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT));
hp->tcvr_type = internal; hp->tcvr_type = internal;
hp->paddr = TCV_PADDR_ITX; hp->paddr = TCV_PADDR_ITX;
ASD(("ISOLATE,"));
happy_meal_tcvr_write(hp, tregs, MII_BMCR, happy_meal_tcvr_write(hp, tregs, MII_BMCR,
(BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE)); (BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE));
result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); result = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
if (result == TCVR_FAILURE) { if (result == TCVR_FAILURE) {
ASD(("phyread_fail>\n")); ASD("phyread_fail\n");
return -1; return -1;
} }
ASD(("phyread_ok,PSELECT>")); ASD("external: ISOLATE, phyread_ok, PSELECT\n");
hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT);
hp->tcvr_type = external; hp->tcvr_type = external;
hp->paddr = TCV_PADDR_ETX; hp->paddr = TCV_PADDR_ETX;
} else { } else {
if (tconfig & TCV_CFG_MDIO1) { if (tconfig & TCV_CFG_MDIO1) {
ASD(("internal<PSELECT,"));
hme_write32(hp, tregs + TCVR_CFG, (tconfig | TCV_CFG_PSELECT)); hme_write32(hp, tregs + TCVR_CFG, (tconfig | TCV_CFG_PSELECT));
ASD(("ISOLATE,"));
happy_meal_tcvr_write(hp, tregs, MII_BMCR, happy_meal_tcvr_write(hp, tregs, MII_BMCR,
(BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE)); (BMCR_LOOPBACK|BMCR_PDOWN|BMCR_ISOLATE));
result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); result = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
if (result == TCVR_FAILURE) { if (result == TCVR_FAILURE) {
ASD(("phyread_fail>\n")); ASD("phyread_fail>\n");
return -1; return -1;
} }
ASD(("phyread_ok,~PSELECT>")); ASD("internal: PSELECT, ISOLATE, phyread_ok, ~PSELECT\n");
hme_write32(hp, tregs + TCVR_CFG, (tconfig & ~(TCV_CFG_PSELECT))); hme_write32(hp, tregs + TCVR_CFG, (tconfig & ~(TCV_CFG_PSELECT)));
hp->tcvr_type = internal; hp->tcvr_type = internal;
hp->paddr = TCV_PADDR_ITX; hp->paddr = TCV_PADDR_ITX;
} }
} }
ASD(("BMCR_RESET ")); ASD("BMCR_RESET...\n");
happy_meal_tcvr_write(hp, tregs, MII_BMCR, BMCR_RESET); happy_meal_tcvr_write(hp, tregs, MII_BMCR, BMCR_RESET);
while (--tries) { while (--tries) {
...@@ -1002,10 +959,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) ...@@ -1002,10 +959,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs)
udelay(20); udelay(20);
} }
if (!tries) { if (!tries) {
ASD(("BMCR RESET FAILED!\n")); ASD("BMCR RESET FAILED!\n");
return -1; return -1;
} }
ASD(("RESET_OK\n")); ASD("RESET_OK\n");
/* Get fresh copies of the PHY registers. */ /* Get fresh copies of the PHY registers. */
hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR); hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR);
...@@ -1013,7 +970,7 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) ...@@ -1013,7 +970,7 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs)
hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2); hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2);
hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE); hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE);
ASD(("UNISOLATE")); ASD("UNISOLATE...\n");
hp->sw_bmcr &= ~(BMCR_ISOLATE); hp->sw_bmcr &= ~(BMCR_ISOLATE);
happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
...@@ -1027,10 +984,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) ...@@ -1027,10 +984,10 @@ static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs)
udelay(20); udelay(20);
} }
if (!tries) { if (!tries) {
ASD((" FAILED!\n")); ASD("UNISOLATE FAILED!\n");
return -1; return -1;
} }
ASD((" SUCCESS and CSCONFIG_DFBYPASS\n")); ASD("SUCCESS and CSCONFIG_DFBYPASS\n");
if (!is_lucent_phy(hp)) { if (!is_lucent_phy(hp)) {
result = happy_meal_tcvr_read(hp, tregs, result = happy_meal_tcvr_read(hp, tregs,
DP83840_CSCONFIG); DP83840_CSCONFIG);
...@@ -1048,60 +1005,55 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr ...@@ -1048,60 +1005,55 @@ static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tr
{ {
unsigned long tconfig = hme_read32(hp, tregs + TCVR_CFG); unsigned long tconfig = hme_read32(hp, tregs + TCVR_CFG);
ASD(("happy_meal_transceiver_check: tcfg=%08lx ", tconfig)); ASD("tcfg=%08lx\n", tconfig);
if (hp->happy_flags & HFLAG_POLL) { if (hp->happy_flags & HFLAG_POLL) {
/* If we are polling, we must stop to get the transceiver type. */ /* If we are polling, we must stop to get the transceiver type. */
ASD(("<polling> "));
if (hp->tcvr_type == internal) { if (hp->tcvr_type == internal) {
if (tconfig & TCV_CFG_MDIO1) { if (tconfig & TCV_CFG_MDIO1) {
ASD(("<internal> <poll stop> "));
happy_meal_poll_stop(hp, tregs); happy_meal_poll_stop(hp, tregs);
hp->paddr = TCV_PADDR_ETX; hp->paddr = TCV_PADDR_ETX;
hp->tcvr_type = external; hp->tcvr_type = external;
ASD(("<external>\n"));
tconfig &= ~(TCV_CFG_PENABLE); tconfig &= ~(TCV_CFG_PENABLE);
tconfig |= TCV_CFG_PSELECT; tconfig |= TCV_CFG_PSELECT;
hme_write32(hp, tregs + TCVR_CFG, tconfig); hme_write32(hp, tregs + TCVR_CFG, tconfig);
ASD("poll stop, internal->external\n");
} }
} else { } else {
if (hp->tcvr_type == external) { if (hp->tcvr_type == external) {
ASD(("<external> "));
if (!(hme_read32(hp, tregs + TCVR_STATUS) >> 16)) { if (!(hme_read32(hp, tregs + TCVR_STATUS) >> 16)) {
ASD(("<poll stop> "));
happy_meal_poll_stop(hp, tregs); happy_meal_poll_stop(hp, tregs);
hp->paddr = TCV_PADDR_ITX; hp->paddr = TCV_PADDR_ITX;
hp->tcvr_type = internal; hp->tcvr_type = internal;
ASD(("<internal>\n"));
hme_write32(hp, tregs + TCVR_CFG, hme_write32(hp, tregs + TCVR_CFG,
hme_read32(hp, tregs + TCVR_CFG) & hme_read32(hp, tregs + TCVR_CFG) &
~(TCV_CFG_PSELECT)); ~(TCV_CFG_PSELECT));
ASD("poll stop, external->internal\n");
} }
ASD(("\n"));
} else { } else {
ASD(("<none>\n")); ASD("polling, none\n");
} }
} }
} else { } else {
u32 reread = hme_read32(hp, tregs + TCVR_CFG); u32 reread = hme_read32(hp, tregs + TCVR_CFG);
/* Else we can just work off of the MDIO bits. */ /* Else we can just work off of the MDIO bits. */
ASD(("<not polling> "));
if (reread & TCV_CFG_MDIO1) { if (reread & TCV_CFG_MDIO1) {
hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT);
hp->paddr = TCV_PADDR_ETX; hp->paddr = TCV_PADDR_ETX;
hp->tcvr_type = external; hp->tcvr_type = external;
ASD(("<external>\n")); ASD("not polling, external\n");
} else { } else {
if (reread & TCV_CFG_MDIO0) { if (reread & TCV_CFG_MDIO0) {
hme_write32(hp, tregs + TCVR_CFG, hme_write32(hp, tregs + TCVR_CFG,
tconfig & ~(TCV_CFG_PSELECT)); tconfig & ~(TCV_CFG_PSELECT));
hp->paddr = TCV_PADDR_ITX; hp->paddr = TCV_PADDR_ITX;
hp->tcvr_type = internal; hp->tcvr_type = internal;
ASD(("<internal>\n")); ASD("not polling, internal\n");
} else { } else {
printk(KERN_ERR "happy meal: Transceiver and a coke please."); netdev_err(hp->dev,
"Transceiver and a coke please.");
hp->tcvr_type = none; /* Grrr... */ hp->tcvr_type = none; /* Grrr... */
ASD(("<none>\n")); ASD("not polling, none\n");
} }
} }
} }
...@@ -1208,15 +1160,14 @@ static void happy_meal_init_rings(struct happy_meal *hp) ...@@ -1208,15 +1160,14 @@ static void happy_meal_init_rings(struct happy_meal *hp)
struct hmeal_init_block *hb = hp->happy_block; struct hmeal_init_block *hb = hp->happy_block;
int i; int i;
HMD(("happy_meal_init_rings: counters to zero, ")); HMD("counters to zero\n");
hp->rx_new = hp->rx_old = hp->tx_new = hp->tx_old = 0; hp->rx_new = hp->rx_old = hp->tx_new = hp->tx_old = 0;
/* Free any skippy bufs left around in the rings. */ /* Free any skippy bufs left around in the rings. */
HMD(("clean, "));
happy_meal_clean_rings(hp); happy_meal_clean_rings(hp);
/* Now get new skippy bufs for the receive ring. */ /* Now get new skippy bufs for the receive ring. */
HMD(("init rxring, ")); HMD("init rxring\n");
for (i = 0; i < RX_RING_SIZE; i++) { for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb; struct sk_buff *skb;
u32 mapping; u32 mapping;
...@@ -1243,11 +1194,11 @@ static void happy_meal_init_rings(struct happy_meal *hp) ...@@ -1243,11 +1194,11 @@ static void happy_meal_init_rings(struct happy_meal *hp)
skb_reserve(skb, RX_OFFSET); skb_reserve(skb, RX_OFFSET);
} }
HMD(("init txring, ")); HMD("init txring\n");
for (i = 0; i < TX_RING_SIZE; i++) for (i = 0; i < TX_RING_SIZE; i++)
hme_write_txd(hp, &hb->happy_meal_txd[i], 0, 0); hme_write_txd(hp, &hb->happy_meal_txd[i], 0, 0);
HMD(("done\n")); HMD("done\n");
} }
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
...@@ -1294,17 +1245,11 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, ...@@ -1294,17 +1245,11 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp,
* XXX so I completely skip checking for it in the BMSR for now. * XXX so I completely skip checking for it in the BMSR for now.
*/ */
#ifdef AUTO_SWITCH_DEBUG ASD("Advertising [ %s%s%s%s]\n",
ASD(("%s: Advertising [ ", hp->dev->name)); hp->sw_advertise & ADVERTISE_10HALF ? "10H " : "",
if (hp->sw_advertise & ADVERTISE_10HALF) hp->sw_advertise & ADVERTISE_10FULL ? "10F " : "",
ASD(("10H ")); hp->sw_advertise & ADVERTISE_100HALF ? "100H " : "",
if (hp->sw_advertise & ADVERTISE_10FULL) hp->sw_advertise & ADVERTISE_100FULL ? "100F " : "");
ASD(("10F "));
if (hp->sw_advertise & ADVERTISE_100HALF)
ASD(("100H "));
if (hp->sw_advertise & ADVERTISE_100FULL)
ASD(("100F "));
#endif
/* Enable Auto-Negotiation, this is usually on already... */ /* Enable Auto-Negotiation, this is usually on already... */
hp->sw_bmcr |= BMCR_ANENABLE; hp->sw_bmcr |= BMCR_ANENABLE;
...@@ -1324,10 +1269,11 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, ...@@ -1324,10 +1269,11 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp,
udelay(10); udelay(10);
} }
if (!timeout) { if (!timeout) {
printk(KERN_ERR "%s: Happy Meal would not start auto negotiation " netdev_err(hp->dev,
"BMCR=0x%04x\n", hp->dev->name, hp->sw_bmcr); "Happy Meal would not start auto negotiation BMCR=0x%04x\n",
printk(KERN_NOTICE "%s: Performing force link detection.\n", hp->sw_bmcr);
hp->dev->name); netdev_notice(hp->dev,
"Performing force link detection.\n");
goto force_link; goto force_link;
} else { } else {
hp->timer_state = arbwait; hp->timer_state = arbwait;
...@@ -1382,70 +1328,69 @@ static int happy_meal_init(struct happy_meal *hp) ...@@ -1382,70 +1328,69 @@ static int happy_meal_init(struct happy_meal *hp)
void __iomem *erxregs = hp->erxregs; void __iomem *erxregs = hp->erxregs;
void __iomem *bregs = hp->bigmacregs; void __iomem *bregs = hp->bigmacregs;
void __iomem *tregs = hp->tcvregs; void __iomem *tregs = hp->tcvregs;
const char *bursts;
u32 regtmp, rxcfg; u32 regtmp, rxcfg;
/* If auto-negotiation timer is running, kill it. */ /* If auto-negotiation timer is running, kill it. */
del_timer(&hp->happy_timer); del_timer(&hp->happy_timer);
HMD(("happy_meal_init: happy_flags[%08x] ", HMD("happy_flags[%08x]\n", hp->happy_flags);
hp->happy_flags));
if (!(hp->happy_flags & HFLAG_INIT)) { if (!(hp->happy_flags & HFLAG_INIT)) {
HMD(("set HFLAG_INIT, ")); HMD("set HFLAG_INIT\n");
hp->happy_flags |= HFLAG_INIT; hp->happy_flags |= HFLAG_INIT;
happy_meal_get_counters(hp, bregs); happy_meal_get_counters(hp, bregs);
} }
/* Stop polling. */ /* Stop polling. */
HMD(("to happy_meal_poll_stop\n")); HMD("to happy_meal_poll_stop\n");
happy_meal_poll_stop(hp, tregs); happy_meal_poll_stop(hp, tregs);
/* Stop transmitter and receiver. */ /* Stop transmitter and receiver. */
HMD(("happy_meal_init: to happy_meal_stop\n")); HMD("to happy_meal_stop\n");
happy_meal_stop(hp, gregs); happy_meal_stop(hp, gregs);
/* Alloc and reset the tx/rx descriptor chains. */ /* Alloc and reset the tx/rx descriptor chains. */
HMD(("happy_meal_init: to happy_meal_init_rings\n")); HMD("to happy_meal_init_rings\n");
happy_meal_init_rings(hp); happy_meal_init_rings(hp);
/* Shut up the MIF. */ /* Shut up the MIF. */
HMD(("happy_meal_init: Disable all MIF irqs (old[%08x]), ", HMD("Disable all MIF irqs (old[%08x])\n",
hme_read32(hp, tregs + TCVR_IMASK))); hme_read32(hp, tregs + TCVR_IMASK));
hme_write32(hp, tregs + TCVR_IMASK, 0xffff); hme_write32(hp, tregs + TCVR_IMASK, 0xffff);
/* See if we can enable the MIF frame on this card to speak to the DP83840. */ /* See if we can enable the MIF frame on this card to speak to the DP83840. */
if (hp->happy_flags & HFLAG_FENABLE) { if (hp->happy_flags & HFLAG_FENABLE) {
HMD(("use frame old[%08x], ", HMD("use frame old[%08x]\n",
hme_read32(hp, tregs + TCVR_CFG))); hme_read32(hp, tregs + TCVR_CFG));
hme_write32(hp, tregs + TCVR_CFG, hme_write32(hp, tregs + TCVR_CFG,
hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_BENABLE)); hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_BENABLE));
} else { } else {
HMD(("use bitbang old[%08x], ", HMD("use bitbang old[%08x]\n",
hme_read32(hp, tregs + TCVR_CFG))); hme_read32(hp, tregs + TCVR_CFG));
hme_write32(hp, tregs + TCVR_CFG, hme_write32(hp, tregs + TCVR_CFG,
hme_read32(hp, tregs + TCVR_CFG) | TCV_CFG_BENABLE); hme_read32(hp, tregs + TCVR_CFG) | TCV_CFG_BENABLE);
} }
/* Check the state of the transceiver. */ /* Check the state of the transceiver. */
HMD(("to happy_meal_transceiver_check\n")); HMD("to happy_meal_transceiver_check\n");
happy_meal_transceiver_check(hp, tregs); happy_meal_transceiver_check(hp, tregs);
/* Put the Big Mac into a sane state. */ /* Put the Big Mac into a sane state. */
HMD(("happy_meal_init: "));
switch(hp->tcvr_type) { switch(hp->tcvr_type) {
case none: case none:
/* Cannot operate if we don't know the transceiver type! */ /* Cannot operate if we don't know the transceiver type! */
HMD(("AAIEEE no transceiver type, EAGAIN")); HMD("AAIEEE no transceiver type, EAGAIN\n");
return -EAGAIN; return -EAGAIN;
case internal: case internal:
/* Using the MII buffers. */ /* Using the MII buffers. */
HMD(("internal, using MII, ")); HMD("internal, using MII\n");
hme_write32(hp, bregs + BMAC_XIFCFG, 0); hme_write32(hp, bregs + BMAC_XIFCFG, 0);
break; break;
case external: case external:
/* Not using the MII, disable it. */ /* Not using the MII, disable it. */
HMD(("external, disable MII, ")); HMD("external, disable MII\n");
hme_write32(hp, bregs + BMAC_XIFCFG, BIGMAC_XCFG_MIIDISAB); hme_write32(hp, bregs + BMAC_XIFCFG, BIGMAC_XCFG_MIIDISAB);
break; break;
} }
...@@ -1454,18 +1399,16 @@ static int happy_meal_init(struct happy_meal *hp) ...@@ -1454,18 +1399,16 @@ static int happy_meal_init(struct happy_meal *hp)
return -EAGAIN; return -EAGAIN;
/* Reset the Happy Meal Big Mac transceiver and the receiver. */ /* Reset the Happy Meal Big Mac transceiver and the receiver. */
HMD(("tx/rx reset, ")); HMD("tx/rx reset\n");
happy_meal_tx_reset(hp, bregs); happy_meal_tx_reset(hp, bregs);
happy_meal_rx_reset(hp, bregs); happy_meal_rx_reset(hp, bregs);
/* Set jam size and inter-packet gaps to reasonable defaults. */ /* Set jam size and inter-packet gaps to reasonable defaults. */
HMD(("jsize/ipg1/ipg2, "));
hme_write32(hp, bregs + BMAC_JSIZE, DEFAULT_JAMSIZE); hme_write32(hp, bregs + BMAC_JSIZE, DEFAULT_JAMSIZE);
hme_write32(hp, bregs + BMAC_IGAP1, DEFAULT_IPG1); hme_write32(hp, bregs + BMAC_IGAP1, DEFAULT_IPG1);
hme_write32(hp, bregs + BMAC_IGAP2, DEFAULT_IPG2); hme_write32(hp, bregs + BMAC_IGAP2, DEFAULT_IPG2);
/* Load up the MAC address and random seed. */ /* Load up the MAC address and random seed. */
HMD(("rseed/macaddr, "));
/* The docs recommend to use the 10LSB of our MAC here. */ /* The docs recommend to use the 10LSB of our MAC here. */
hme_write32(hp, bregs + BMAC_RSEED, ((e[5] | e[4]<<8)&0x3ff)); hme_write32(hp, bregs + BMAC_RSEED, ((e[5] | e[4]<<8)&0x3ff));
...@@ -1474,7 +1417,6 @@ static int happy_meal_init(struct happy_meal *hp) ...@@ -1474,7 +1417,6 @@ static int happy_meal_init(struct happy_meal *hp)
hme_write32(hp, bregs + BMAC_MACADDR1, ((e[2] << 8) | e[3])); hme_write32(hp, bregs + BMAC_MACADDR1, ((e[2] << 8) | e[3]));
hme_write32(hp, bregs + BMAC_MACADDR0, ((e[0] << 8) | e[1])); hme_write32(hp, bregs + BMAC_MACADDR0, ((e[0] << 8) | e[1]));
HMD(("htable, "));
if ((hp->dev->flags & IFF_ALLMULTI) || if ((hp->dev->flags & IFF_ALLMULTI) ||
(netdev_mc_count(hp->dev) > 64)) { (netdev_mc_count(hp->dev) > 64)) {
hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff);
...@@ -1504,9 +1446,9 @@ static int happy_meal_init(struct happy_meal *hp) ...@@ -1504,9 +1446,9 @@ static int happy_meal_init(struct happy_meal *hp)
} }
/* Set the RX and TX ring ptrs. */ /* Set the RX and TX ring ptrs. */
HMD(("ring ptrs rxr[%08x] txr[%08x]\n", HMD("ring ptrs rxr[%08x] txr[%08x]\n",
((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)), ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)),
((__u32)hp->hblock_dvma + hblock_offset(happy_meal_txd, 0)))); ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_txd, 0)));
hme_write32(hp, erxregs + ERX_RING, hme_write32(hp, erxregs + ERX_RING,
((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0))); ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)));
hme_write32(hp, etxregs + ETX_RING, hme_write32(hp, etxregs + ETX_RING,
...@@ -1524,9 +1466,6 @@ static int happy_meal_init(struct happy_meal *hp) ...@@ -1524,9 +1466,6 @@ static int happy_meal_init(struct happy_meal *hp)
| 0x4); | 0x4);
/* Set the supported burst sizes. */ /* Set the supported burst sizes. */
HMD(("happy_meal_init: old[%08x] bursts<",
hme_read32(hp, gregs + GREG_CFG)));
#ifndef CONFIG_SPARC #ifndef CONFIG_SPARC
/* It is always PCI and can handle 64byte bursts. */ /* It is always PCI and can handle 64byte bursts. */
hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST64); hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST64);
...@@ -1554,34 +1493,35 @@ static int happy_meal_init(struct happy_meal *hp) ...@@ -1554,34 +1493,35 @@ static int happy_meal_init(struct happy_meal *hp)
} }
#endif #endif
HMD(("64>")); bursts = "64";
hme_write32(hp, gregs + GREG_CFG, gcfg); hme_write32(hp, gregs + GREG_CFG, gcfg);
} else if (hp->happy_bursts & DMA_BURST32) { } else if (hp->happy_bursts & DMA_BURST32) {
HMD(("32>")); bursts = "32";
hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST32); hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST32);
} else if (hp->happy_bursts & DMA_BURST16) { } else if (hp->happy_bursts & DMA_BURST16) {
HMD(("16>")); bursts = "16";
hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST16); hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST16);
} else { } else {
HMD(("XXX>")); bursts = "XXX";
hme_write32(hp, gregs + GREG_CFG, 0); hme_write32(hp, gregs + GREG_CFG, 0);
} }
#endif /* CONFIG_SPARC */ #endif /* CONFIG_SPARC */
HMD("old[%08x] bursts<%s>\n",
hme_read32(hp, gregs + GREG_CFG), bursts);
/* Turn off interrupts we do not want to hear. */ /* Turn off interrupts we do not want to hear. */
HMD((", enable global interrupts, "));
hme_write32(hp, gregs + GREG_IMASK, hme_write32(hp, gregs + GREG_IMASK,
(GREG_IMASK_GOTFRAME | GREG_IMASK_RCNTEXP | (GREG_IMASK_GOTFRAME | GREG_IMASK_RCNTEXP |
GREG_IMASK_SENTFRAME | GREG_IMASK_TXPERR)); GREG_IMASK_SENTFRAME | GREG_IMASK_TXPERR));
/* Set the transmit ring buffer size. */ /* Set the transmit ring buffer size. */
HMD(("tx rsize=%d oreg[%08x], ", (int)TX_RING_SIZE, HMD("tx rsize=%d oreg[%08x]\n", (int)TX_RING_SIZE,
hme_read32(hp, etxregs + ETX_RSIZE))); hme_read32(hp, etxregs + ETX_RSIZE));
hme_write32(hp, etxregs + ETX_RSIZE, (TX_RING_SIZE >> ETX_RSIZE_SHIFT) - 1); hme_write32(hp, etxregs + ETX_RSIZE, (TX_RING_SIZE >> ETX_RSIZE_SHIFT) - 1);
/* Enable transmitter DVMA. */ /* Enable transmitter DVMA. */
HMD(("tx dma enable old[%08x], ", HMD("tx dma enable old[%08x]\n", hme_read32(hp, etxregs + ETX_CFG));
hme_read32(hp, etxregs + ETX_CFG)));
hme_write32(hp, etxregs + ETX_CFG, hme_write32(hp, etxregs + ETX_CFG,
hme_read32(hp, etxregs + ETX_CFG) | ETX_CFG_DMAENABLE); hme_read32(hp, etxregs + ETX_CFG) | ETX_CFG_DMAENABLE);
...@@ -1590,21 +1530,23 @@ static int happy_meal_init(struct happy_meal *hp) ...@@ -1590,21 +1530,23 @@ static int happy_meal_init(struct happy_meal *hp)
* properly. I cannot think of a sane way to provide complete * properly. I cannot think of a sane way to provide complete
* coverage for this hardware bug yet. * coverage for this hardware bug yet.
*/ */
HMD(("erx regs bug old[%08x]\n", HMD("erx regs bug old[%08x]\n",
hme_read32(hp, erxregs + ERX_CFG))); hme_read32(hp, erxregs + ERX_CFG));
hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET));
regtmp = hme_read32(hp, erxregs + ERX_CFG); regtmp = hme_read32(hp, erxregs + ERX_CFG);
hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET));
if (hme_read32(hp, erxregs + ERX_CFG) != ERX_CFG_DEFAULT(RX_OFFSET)) { if (hme_read32(hp, erxregs + ERX_CFG) != ERX_CFG_DEFAULT(RX_OFFSET)) {
printk(KERN_ERR "happy meal: Eieee, rx config register gets greasy fries.\n"); netdev_err(hp->dev,
printk(KERN_ERR "happy meal: Trying to set %08x, reread gives %08x\n", "Eieee, rx config register gets greasy fries.\n");
netdev_err(hp->dev,
"Trying to set %08x, reread gives %08x\n",
ERX_CFG_DEFAULT(RX_OFFSET), regtmp); ERX_CFG_DEFAULT(RX_OFFSET), regtmp);
/* XXX Should return failure here... */ /* XXX Should return failure here... */
} }
/* Enable Big Mac hash table filter. */ /* Enable Big Mac hash table filter. */
HMD(("happy_meal_init: enable hash rx_cfg_old[%08x], ", HMD("enable hash rx_cfg_old[%08x]\n",
hme_read32(hp, bregs + BMAC_RXCFG))); hme_read32(hp, bregs + BMAC_RXCFG));
rxcfg = BIGMAC_RXCFG_HENABLE | BIGMAC_RXCFG_REJME; rxcfg = BIGMAC_RXCFG_HENABLE | BIGMAC_RXCFG_REJME;
if (hp->dev->flags & IFF_PROMISC) if (hp->dev->flags & IFF_PROMISC)
rxcfg |= BIGMAC_RXCFG_PMISC; rxcfg |= BIGMAC_RXCFG_PMISC;
...@@ -1614,7 +1556,7 @@ static int happy_meal_init(struct happy_meal *hp) ...@@ -1614,7 +1556,7 @@ static int happy_meal_init(struct happy_meal *hp)
udelay(10); udelay(10);
/* Ok, configure the Big Mac transmitter. */ /* Ok, configure the Big Mac transmitter. */
HMD(("BIGMAC init, ")); HMD("BIGMAC init\n");
regtmp = 0; regtmp = 0;
if (hp->happy_flags & HFLAG_FULL) if (hp->happy_flags & HFLAG_FULL)
regtmp |= BIGMAC_TXCFG_FULLDPLX; regtmp |= BIGMAC_TXCFG_FULLDPLX;
...@@ -1638,14 +1580,13 @@ static int happy_meal_init(struct happy_meal *hp) ...@@ -1638,14 +1580,13 @@ static int happy_meal_init(struct happy_meal *hp)
if (hp->tcvr_type == external) if (hp->tcvr_type == external)
regtmp |= BIGMAC_XCFG_MIIDISAB; regtmp |= BIGMAC_XCFG_MIIDISAB;
HMD(("XIF config old[%08x], ", HMD("XIF config old[%08x]\n", hme_read32(hp, bregs + BMAC_XIFCFG));
hme_read32(hp, bregs + BMAC_XIFCFG)));
hme_write32(hp, bregs + BMAC_XIFCFG, regtmp); hme_write32(hp, bregs + BMAC_XIFCFG, regtmp);
/* Start things up. */ /* Start things up. */
HMD(("tx old[%08x] and rx [%08x] ON!\n", HMD("tx old[%08x] and rx [%08x] ON!\n",
hme_read32(hp, bregs + BMAC_TXCFG), hme_read32(hp, bregs + BMAC_TXCFG),
hme_read32(hp, bregs + BMAC_RXCFG))); hme_read32(hp, bregs + BMAC_RXCFG));
/* Set larger TX/RX size to allow for 802.1q */ /* Set larger TX/RX size to allow for 802.1q */
hme_write32(hp, bregs + BMAC_TXMAX, ETH_FRAME_LEN + 8); hme_write32(hp, bregs + BMAC_TXMAX, ETH_FRAME_LEN + 8);
...@@ -1735,25 +1676,26 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) ...@@ -1735,25 +1676,26 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status)
GREG_STAT_MIFIRQ | GREG_STAT_TXEACK | GREG_STAT_TXLERR | GREG_STAT_MIFIRQ | GREG_STAT_TXEACK | GREG_STAT_TXLERR |
GREG_STAT_TXPERR | GREG_STAT_TXTERR | GREG_STAT_SLVERR | GREG_STAT_TXPERR | GREG_STAT_TXTERR | GREG_STAT_SLVERR |
GREG_STAT_SLVPERR)) GREG_STAT_SLVPERR))
printk(KERN_ERR "%s: Error interrupt for happy meal, status = %08x\n", netdev_err(hp->dev,
hp->dev->name, status); "Error interrupt for happy meal, status = %08x\n",
status);
if (status & GREG_STAT_RFIFOVF) { if (status & GREG_STAT_RFIFOVF) {
/* Receive FIFO overflow is harmless and the hardware will take /* Receive FIFO overflow is harmless and the hardware will take
care of it, just some packets are lost. Who cares. */ care of it, just some packets are lost. Who cares. */
printk(KERN_DEBUG "%s: Happy Meal receive FIFO overflow.\n", hp->dev->name); netdev_dbg(hp->dev, "Happy Meal receive FIFO overflow.\n");
} }
if (status & GREG_STAT_STSTERR) { if (status & GREG_STAT_STSTERR) {
/* BigMAC SQE link test failed. */ /* BigMAC SQE link test failed. */
printk(KERN_ERR "%s: Happy Meal BigMAC SQE test failed.\n", hp->dev->name); netdev_err(hp->dev, "Happy Meal BigMAC SQE test failed.\n");
reset = 1; reset = 1;
} }
if (status & GREG_STAT_TFIFO_UND) { if (status & GREG_STAT_TFIFO_UND) {
/* Transmit FIFO underrun, again DMA error likely. */ /* Transmit FIFO underrun, again DMA error likely. */
printk(KERN_ERR "%s: Happy Meal transmitter FIFO underrun, DMA error.\n", netdev_err(hp->dev,
hp->dev->name); "Happy Meal transmitter FIFO underrun, DMA error.\n");
reset = 1; reset = 1;
} }
...@@ -1761,7 +1703,7 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) ...@@ -1761,7 +1703,7 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status)
/* Driver error, tried to transmit something larger /* Driver error, tried to transmit something larger
* than ethernet max mtu. * than ethernet max mtu.
*/ */
printk(KERN_ERR "%s: Happy Meal MAX Packet size error.\n", hp->dev->name); netdev_err(hp->dev, "Happy Meal MAX Packet size error.\n");
reset = 1; reset = 1;
} }
...@@ -1771,21 +1713,16 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) ...@@ -1771,21 +1713,16 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status)
* faster than the interrupt handler could keep up * faster than the interrupt handler could keep up
* with. * with.
*/ */
printk(KERN_INFO "%s: Happy Meal out of receive " netdev_info(hp->dev,
"descriptors, packet dropped.\n", "Happy Meal out of receive descriptors, packet dropped.\n");
hp->dev->name);
} }
if (status & (GREG_STAT_RXERR|GREG_STAT_RXPERR|GREG_STAT_RXTERR)) { if (status & (GREG_STAT_RXERR|GREG_STAT_RXPERR|GREG_STAT_RXTERR)) {
/* All sorts of DMA receive errors. */ /* All sorts of DMA receive errors. */
printk(KERN_ERR "%s: Happy Meal rx DMA errors [ ", hp->dev->name); netdev_err(hp->dev, "Happy Meal rx DMA errors [ %s%s%s]\n",
if (status & GREG_STAT_RXERR) status & GREG_STAT_RXERR ? "GenericError " : "",
printk("GenericError "); status & GREG_STAT_RXPERR ? "ParityError " : "",
if (status & GREG_STAT_RXPERR) status & GREG_STAT_RXTERR ? "RxTagBotch " : "");
printk("ParityError ");
if (status & GREG_STAT_RXTERR)
printk("RxTagBotch ");
printk("]\n");
reset = 1; reset = 1;
} }
...@@ -1793,29 +1730,24 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) ...@@ -1793,29 +1730,24 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status)
/* Driver bug, didn't set EOP bit in tx descriptor given /* Driver bug, didn't set EOP bit in tx descriptor given
* to the happy meal. * to the happy meal.
*/ */
printk(KERN_ERR "%s: EOP not set in happy meal transmit descriptor!\n", netdev_err(hp->dev,
hp->dev->name); "EOP not set in happy meal transmit descriptor!\n");
reset = 1; reset = 1;
} }
if (status & GREG_STAT_MIFIRQ) { if (status & GREG_STAT_MIFIRQ) {
/* MIF signalled an interrupt, were we polling it? */ /* MIF signalled an interrupt, were we polling it? */
printk(KERN_ERR "%s: Happy Meal MIF interrupt.\n", hp->dev->name); netdev_err(hp->dev, "Happy Meal MIF interrupt.\n");
} }
if (status & if (status &
(GREG_STAT_TXEACK|GREG_STAT_TXLERR|GREG_STAT_TXPERR|GREG_STAT_TXTERR)) { (GREG_STAT_TXEACK|GREG_STAT_TXLERR|GREG_STAT_TXPERR|GREG_STAT_TXTERR)) {
/* All sorts of transmit DMA errors. */ /* All sorts of transmit DMA errors. */
printk(KERN_ERR "%s: Happy Meal tx DMA errors [ ", hp->dev->name); netdev_err(hp->dev, "Happy Meal tx DMA errors [ %s%s%s%s]\n",
if (status & GREG_STAT_TXEACK) status & GREG_STAT_TXEACK ? "GenericError " : "",
printk("GenericError "); status & GREG_STAT_TXLERR ? "LateError " : "",
if (status & GREG_STAT_TXLERR) status & GREG_STAT_TXPERR ? "ParityError " : "",
printk("LateError "); status & GREG_STAT_TXTERR ? "TagBotch " : "");
if (status & GREG_STAT_TXPERR)
printk("ParityError ");
if (status & GREG_STAT_TXTERR)
printk("TagBotch ");
printk("]\n");
reset = 1; reset = 1;
} }
...@@ -1823,14 +1755,14 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) ...@@ -1823,14 +1755,14 @@ static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status)
/* Bus or parity error when cpu accessed happy meal registers /* Bus or parity error when cpu accessed happy meal registers
* or it's internal FIFO's. Should never see this. * or it's internal FIFO's. Should never see this.
*/ */
printk(KERN_ERR "%s: Happy Meal register access SBUS slave (%s) error.\n", netdev_err(hp->dev,
hp->dev->name, "Happy Meal register access SBUS slave (%s) error.\n",
(status & GREG_STAT_SLVPERR) ? "parity" : "generic"); (status & GREG_STAT_SLVPERR) ? "parity" : "generic");
reset = 1; reset = 1;
} }
if (reset) { if (reset) {
printk(KERN_NOTICE "%s: Resetting...\n", hp->dev->name); netdev_notice(hp->dev, "Resetting...\n");
happy_meal_init(hp); happy_meal_init(hp);
return 1; return 1;
} }
...@@ -1842,22 +1774,22 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) ...@@ -1842,22 +1774,22 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp)
{ {
void __iomem *tregs = hp->tcvregs; void __iomem *tregs = hp->tcvregs;
printk(KERN_INFO "%s: Link status change.\n", hp->dev->name); netdev_info(hp->dev, "Link status change.\n");
hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR);
hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA); hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA);
/* Use the fastest transmission protocol possible. */ /* Use the fastest transmission protocol possible. */
if (hp->sw_lpa & LPA_100FULL) { if (hp->sw_lpa & LPA_100FULL) {
printk(KERN_INFO "%s: Switching to 100Mbps at full duplex.", hp->dev->name); netdev_info(hp->dev, "Switching to 100Mbps at full duplex.\n");
hp->sw_bmcr |= (BMCR_FULLDPLX | BMCR_SPEED100); hp->sw_bmcr |= (BMCR_FULLDPLX | BMCR_SPEED100);
} else if (hp->sw_lpa & LPA_100HALF) { } else if (hp->sw_lpa & LPA_100HALF) {
printk(KERN_INFO "%s: Switching to 100MBps at half duplex.", hp->dev->name); netdev_info(hp->dev, "Switching to 100MBps at half duplex.\n");
hp->sw_bmcr |= BMCR_SPEED100; hp->sw_bmcr |= BMCR_SPEED100;
} else if (hp->sw_lpa & LPA_10FULL) { } else if (hp->sw_lpa & LPA_10FULL) {
printk(KERN_INFO "%s: Switching to 10MBps at full duplex.", hp->dev->name); netdev_info(hp->dev, "Switching to 10MBps at full duplex.\n");
hp->sw_bmcr |= BMCR_FULLDPLX; hp->sw_bmcr |= BMCR_FULLDPLX;
} else { } else {
printk(KERN_INFO "%s: Using 10Mbps at half duplex.", hp->dev->name); netdev_info(hp->dev, "Using 10Mbps at half duplex.\n");
} }
happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
...@@ -1865,12 +1797,6 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp) ...@@ -1865,12 +1797,6 @@ static void happy_meal_mif_interrupt(struct happy_meal *hp)
happy_meal_poll_stop(hp, tregs); happy_meal_poll_stop(hp, tregs);
} }
#ifdef TXDEBUG
#define TXD(x) printk x
#else
#define TXD(x)
#endif
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void happy_meal_tx(struct happy_meal *hp) static void happy_meal_tx(struct happy_meal *hp)
{ {
...@@ -1880,13 +1806,12 @@ static void happy_meal_tx(struct happy_meal *hp) ...@@ -1880,13 +1806,12 @@ static void happy_meal_tx(struct happy_meal *hp)
int elem; int elem;
elem = hp->tx_old; elem = hp->tx_old;
TXD(("TX<"));
while (elem != hp->tx_new) { while (elem != hp->tx_new) {
struct sk_buff *skb; struct sk_buff *skb;
u32 flags, dma_addr, dma_len; u32 flags, dma_addr, dma_len;
int frag; int frag;
TXD(("[%d]", elem)); netdev_vdbg(hp->dev, "TX[%d]\n", elem);
this = &txbase[elem]; this = &txbase[elem];
flags = hme_read_desc32(hp, &this->tx_flags); flags = hme_read_desc32(hp, &this->tx_flags);
if (flags & TXFLAG_OWN) if (flags & TXFLAG_OWN)
...@@ -1922,19 +1847,12 @@ static void happy_meal_tx(struct happy_meal *hp) ...@@ -1922,19 +1847,12 @@ static void happy_meal_tx(struct happy_meal *hp)
dev->stats.tx_packets++; dev->stats.tx_packets++;
} }
hp->tx_old = elem; hp->tx_old = elem;
TXD((">"));
if (netif_queue_stopped(dev) && if (netif_queue_stopped(dev) &&
TX_BUFFS_AVAIL(hp) > (MAX_SKB_FRAGS + 1)) TX_BUFFS_AVAIL(hp) > (MAX_SKB_FRAGS + 1))
netif_wake_queue(dev); netif_wake_queue(dev);
} }
#ifdef RXDEBUG
#define RXD(x) printk x
#else
#define RXD(x)
#endif
/* Originally I used to handle the allocation failure by just giving back just /* Originally I used to handle the allocation failure by just giving back just
* that one ring buffer to the happy meal. Problem is that usually when that * that one ring buffer to the happy meal. Problem is that usually when that
* condition is triggered, the happy meal expects you to do something reasonable * condition is triggered, the happy meal expects you to do something reasonable
...@@ -1951,7 +1869,6 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) ...@@ -1951,7 +1869,6 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
int elem = hp->rx_new, drops = 0; int elem = hp->rx_new, drops = 0;
u32 flags; u32 flags;
RXD(("RX<"));
this = &rxbase[elem]; this = &rxbase[elem];
while (!((flags = hme_read_desc32(hp, &this->rx_flags)) & RXFLAG_OWN)) { while (!((flags = hme_read_desc32(hp, &this->rx_flags)) & RXFLAG_OWN)) {
struct sk_buff *skb; struct sk_buff *skb;
...@@ -1959,11 +1876,9 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) ...@@ -1959,11 +1876,9 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
u16 csum = flags & RXFLAG_CSUM; u16 csum = flags & RXFLAG_CSUM;
u32 dma_addr = hme_read_desc32(hp, &this->rx_addr); u32 dma_addr = hme_read_desc32(hp, &this->rx_addr);
RXD(("[%d ", elem));
/* Check for errors. */ /* Check for errors. */
if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) { if ((len < ETH_ZLEN) || (flags & RXFLAG_OVERFLOW)) {
RXD(("ERR(%08x)]", flags)); netdev_vdbg(dev, "RX[%d ERR(%08x)]", elem, flags);
dev->stats.rx_errors++; dev->stats.rx_errors++;
if (len < ETH_ZLEN) if (len < ETH_ZLEN)
dev->stats.rx_length_errors++; dev->stats.rx_length_errors++;
...@@ -2035,7 +1950,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) ...@@ -2035,7 +1950,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
skb->csum = csum_unfold(~(__force __sum16)htons(csum)); skb->csum = csum_unfold(~(__force __sum16)htons(csum));
skb->ip_summed = CHECKSUM_COMPLETE; skb->ip_summed = CHECKSUM_COMPLETE;
RXD(("len=%d csum=%4x]", len, csum)); netdev_vdbg(dev, "RX[%d len=%d csum=%4x]", elem, len, csum);
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb); netif_rx(skb);
...@@ -2047,8 +1962,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) ...@@ -2047,8 +1962,7 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
} }
hp->rx_new = elem; hp->rx_new = elem;
if (drops) if (drops)
printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n", hp->dev->name); netdev_info(hp->dev, "Memory squeeze, deferring packet.\n");
RXD((">"));
} }
static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) static irqreturn_t happy_meal_interrupt(int irq, void *dev_id)
...@@ -2057,32 +1971,25 @@ static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) ...@@ -2057,32 +1971,25 @@ static irqreturn_t happy_meal_interrupt(int irq, void *dev_id)
struct happy_meal *hp = netdev_priv(dev); struct happy_meal *hp = netdev_priv(dev);
u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT);
HMD(("happy_meal_interrupt: status=%08x ", happy_status)); HMD("status=%08x\n", happy_status);
spin_lock(&hp->happy_lock); spin_lock(&hp->happy_lock);
if (happy_status & GREG_STAT_ERRORS) { if (happy_status & GREG_STAT_ERRORS) {
HMD(("ERRORS "));
if (happy_meal_is_not_so_happy(hp, /* un- */ happy_status)) if (happy_meal_is_not_so_happy(hp, /* un- */ happy_status))
goto out; goto out;
} }
if (happy_status & GREG_STAT_MIFIRQ) { if (happy_status & GREG_STAT_MIFIRQ)
HMD(("MIFIRQ "));
happy_meal_mif_interrupt(hp); happy_meal_mif_interrupt(hp);
}
if (happy_status & GREG_STAT_TXALL) { if (happy_status & GREG_STAT_TXALL)
HMD(("TXALL "));
happy_meal_tx(hp); happy_meal_tx(hp);
}
if (happy_status & GREG_STAT_RXTOHOST) { if (happy_status & GREG_STAT_RXTOHOST)
HMD(("RXTOHOST "));
happy_meal_rx(hp, dev); happy_meal_rx(hp, dev);
}
HMD(("done\n")); HMD("done\n");
out: out:
spin_unlock(&hp->happy_lock); spin_unlock(&hp->happy_lock);
...@@ -2100,7 +2007,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) ...@@ -2100,7 +2007,7 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie)
struct happy_meal *hp = netdev_priv(dev); struct happy_meal *hp = netdev_priv(dev);
u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT);
HMD(("quattro_interrupt: status=%08x ", happy_status)); HMD("status=%08x\n", happy_status);
if (!(happy_status & (GREG_STAT_ERRORS | if (!(happy_status & (GREG_STAT_ERRORS |
GREG_STAT_MIFIRQ | GREG_STAT_MIFIRQ |
...@@ -2110,31 +2017,23 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie) ...@@ -2110,31 +2017,23 @@ static irqreturn_t quattro_sbus_interrupt(int irq, void *cookie)
spin_lock(&hp->happy_lock); spin_lock(&hp->happy_lock);
if (happy_status & GREG_STAT_ERRORS) { if (happy_status & GREG_STAT_ERRORS)
HMD(("ERRORS "));
if (happy_meal_is_not_so_happy(hp, happy_status)) if (happy_meal_is_not_so_happy(hp, happy_status))
goto next; goto next;
}
if (happy_status & GREG_STAT_MIFIRQ) { if (happy_status & GREG_STAT_MIFIRQ)
HMD(("MIFIRQ "));
happy_meal_mif_interrupt(hp); happy_meal_mif_interrupt(hp);
}
if (happy_status & GREG_STAT_TXALL) { if (happy_status & GREG_STAT_TXALL)
HMD(("TXALL "));
happy_meal_tx(hp); happy_meal_tx(hp);
}
if (happy_status & GREG_STAT_RXTOHOST) { if (happy_status & GREG_STAT_RXTOHOST)
HMD(("RXTOHOST "));
happy_meal_rx(hp, dev); happy_meal_rx(hp, dev);
}
next: next:
spin_unlock(&hp->happy_lock); spin_unlock(&hp->happy_lock);
} }
HMD(("done\n")); HMD("done\n");
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -2145,8 +2044,6 @@ static int happy_meal_open(struct net_device *dev) ...@@ -2145,8 +2044,6 @@ static int happy_meal_open(struct net_device *dev)
struct happy_meal *hp = netdev_priv(dev); struct happy_meal *hp = netdev_priv(dev);
int res; int res;
HMD(("happy_meal_open: "));
/* On SBUS Quattro QFE cards, all hme interrupts are concentrated /* On SBUS Quattro QFE cards, all hme interrupts are concentrated
* into a single source which we register handling at probe time. * into a single source which we register handling at probe time.
*/ */
...@@ -2154,15 +2051,14 @@ static int happy_meal_open(struct net_device *dev) ...@@ -2154,15 +2051,14 @@ static int happy_meal_open(struct net_device *dev)
res = request_irq(hp->irq, happy_meal_interrupt, IRQF_SHARED, res = request_irq(hp->irq, happy_meal_interrupt, IRQF_SHARED,
dev->name, dev); dev->name, dev);
if (res) { if (res) {
HMD(("EAGAIN\n")); HMD("EAGAIN\n");
printk(KERN_ERR "happy_meal(SBUS): Can't order irq %d to go.\n", netdev_err(dev, "Can't order irq %d to go.\n", hp->irq);
hp->irq);
return -EAGAIN; return -EAGAIN;
} }
} }
HMD(("to happy_meal_init\n")); HMD("to happy_meal_init\n");
spin_lock_irq(&hp->happy_lock); spin_lock_irq(&hp->happy_lock);
res = happy_meal_init(hp); res = happy_meal_init(hp);
...@@ -2196,19 +2092,13 @@ static int happy_meal_close(struct net_device *dev) ...@@ -2196,19 +2092,13 @@ static int happy_meal_close(struct net_device *dev)
return 0; return 0;
} }
#ifdef SXDEBUG
#define SXD(x) printk x
#else
#define SXD(x)
#endif
static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue) static void happy_meal_tx_timeout(struct net_device *dev, unsigned int txqueue)
{ {
struct happy_meal *hp = netdev_priv(dev); struct happy_meal *hp = netdev_priv(dev);
printk (KERN_ERR "%s: transmit timed out, resetting\n", dev->name); netdev_err(dev, "transmit timed out, resetting\n");
tx_dump_log(); tx_dump_log();
printk (KERN_ERR "%s: Happy Status %08x TX[%08x:%08x]\n", dev->name, netdev_err(dev, "Happy Status %08x TX[%08x:%08x]\n",
hme_read32(hp, hp->gregs + GREG_STAT), hme_read32(hp, hp->gregs + GREG_STAT),
hme_read32(hp, hp->etxregs + ETX_CFG), hme_read32(hp, hp->etxregs + ETX_CFG),
hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); hme_read32(hp, hp->bigmacregs + BMAC_TXCFG));
...@@ -2261,13 +2151,12 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb, ...@@ -2261,13 +2151,12 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb,
if (TX_BUFFS_AVAIL(hp) <= (skb_shinfo(skb)->nr_frags + 1)) { if (TX_BUFFS_AVAIL(hp) <= (skb_shinfo(skb)->nr_frags + 1)) {
netif_stop_queue(dev); netif_stop_queue(dev);
spin_unlock_irq(&hp->happy_lock); spin_unlock_irq(&hp->happy_lock);
printk(KERN_ERR "%s: BUG! Tx Ring full when queue awake!\n", netdev_err(dev, "BUG! Tx Ring full when queue awake!\n");
dev->name);
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
} }
entry = hp->tx_new; entry = hp->tx_new;
SXD(("SX<l[%d]e[%d]>", len, entry)); netdev_vdbg(dev, "SX<l[%d]e[%d]>\n", skb->len, entry);
hp->tx_skbs[entry] = skb; hp->tx_skbs[entry] = skb;
if (skb_shinfo(skb)->nr_frags == 0) { if (skb_shinfo(skb)->nr_frags == 0) {
...@@ -2467,8 +2356,7 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info ...@@ -2467,8 +2356,7 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
{ {
struct happy_meal *hp = netdev_priv(dev); struct happy_meal *hp = netdev_priv(dev);
strscpy(info->driver, "sunhme", sizeof(info->driver)); strscpy(info->driver, DRV_NAME, sizeof(info->driver));
strscpy(info->version, "2.02", sizeof(info->version));
if (hp->happy_flags & HFLAG_PCI) { if (hp->happy_flags & HFLAG_PCI) {
struct pci_dev *pdev = hp->happy_dev; struct pci_dev *pdev = hp->happy_dev;
strscpy(info->bus_info, pci_name(pdev), sizeof(info->bus_info)); strscpy(info->bus_info, pci_name(pdev), sizeof(info->bus_info));
...@@ -2504,8 +2392,6 @@ static const struct ethtool_ops hme_ethtool_ops = { ...@@ -2504,8 +2392,6 @@ static const struct ethtool_ops hme_ethtool_ops = {
.set_link_ksettings = hme_set_link_ksettings, .set_link_ksettings = hme_set_link_ksettings,
}; };
static int hme_version_printed;
#ifdef CONFIG_SBUS #ifdef CONFIG_SBUS
/* Given a happy meal sbus device, find it's quattro parent. /* Given a happy meal sbus device, find it's quattro parent.
* If none exist, allocate and return a new one. * If none exist, allocate and return a new one.
...@@ -2524,18 +2410,16 @@ static struct quattro *quattro_sbus_find(struct platform_device *child) ...@@ -2524,18 +2410,16 @@ static struct quattro *quattro_sbus_find(struct platform_device *child)
return qp; return qp;
qp = kmalloc(sizeof(struct quattro), GFP_KERNEL); qp = kmalloc(sizeof(struct quattro), GFP_KERNEL);
if (qp != NULL) { if (!qp)
int i; return NULL;
for (i = 0; i < 4; i++) memset(qp->happy_meals, 0, sizeof(*qp->happy_meals));
qp->happy_meals[i] = NULL;
qp->quattro_dev = child; qp->quattro_dev = child;
qp->next = qfe_sbus_list; qp->next = qfe_sbus_list;
qfe_sbus_list = qp; qfe_sbus_list = qp;
platform_set_drvdata(op, qp); platform_set_drvdata(op, qp);
}
return qp; return qp;
} }
...@@ -2563,8 +2447,9 @@ static int __init quattro_sbus_register_irqs(void) ...@@ -2563,8 +2447,9 @@ static int __init quattro_sbus_register_irqs(void)
IRQF_SHARED, "Quattro", IRQF_SHARED, "Quattro",
qp); qp);
if (err != 0) { if (err != 0) {
printk(KERN_ERR "Quattro HME: IRQ registration " dev_err(&op->dev,
"error %d.\n", err); "Quattro HME: IRQ registration error %d.\n",
err);
return err; return err;
} }
} }
...@@ -2595,19 +2480,23 @@ static void quattro_sbus_free_irqs(void) ...@@ -2595,19 +2480,23 @@ static void quattro_sbus_free_irqs(void)
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
static struct quattro *quattro_pci_find(struct pci_dev *pdev) static struct quattro *quattro_pci_find(struct pci_dev *pdev)
{ {
int i;
struct pci_dev *bdev = pdev->bus->self; struct pci_dev *bdev = pdev->bus->self;
struct quattro *qp; struct quattro *qp;
if (!bdev) return NULL; if (!bdev)
return ERR_PTR(-ENODEV);
for (qp = qfe_pci_list; qp != NULL; qp = qp->next) { for (qp = qfe_pci_list; qp != NULL; qp = qp->next) {
struct pci_dev *qpdev = qp->quattro_dev; struct pci_dev *qpdev = qp->quattro_dev;
if (qpdev == bdev) if (qpdev == bdev)
return qp; return qp;
} }
qp = kmalloc(sizeof(struct quattro), GFP_KERNEL); qp = kmalloc(sizeof(struct quattro), GFP_KERNEL);
if (qp != NULL) { if (!qp)
int i; return ERR_PTR(-ENOMEM);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
qp->happy_meals[i] = NULL; qp->happy_meals[i] = NULL;
...@@ -2618,7 +2507,6 @@ static struct quattro *quattro_pci_find(struct pci_dev *pdev) ...@@ -2618,7 +2507,6 @@ static struct quattro *quattro_pci_find(struct pci_dev *pdev)
/* No range tricks necessary on PCI. */ /* No range tricks necessary on PCI. */
qp->nranges = 0; qp->nranges = 0;
}
return qp; return qp;
} }
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
...@@ -2668,9 +2556,6 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) ...@@ -2668,9 +2556,6 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe)
goto err_out; goto err_out;
SET_NETDEV_DEV(dev, &op->dev); SET_NETDEV_DEV(dev, &op->dev);
if (hme_version_printed++ == 0)
printk(KERN_INFO "%s", version);
/* If user did not specify a MAC address specifically, use /* If user did not specify a MAC address specifically, use
* the Quattro local-mac-address property... * the Quattro local-mac-address property...
*/ */
...@@ -2712,35 +2597,35 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) ...@@ -2712,35 +2597,35 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe)
hp->gregs = of_ioremap(&op->resource[0], 0, hp->gregs = of_ioremap(&op->resource[0], 0,
GREG_REG_SIZE, "HME Global Regs"); GREG_REG_SIZE, "HME Global Regs");
if (!hp->gregs) { if (!hp->gregs) {
printk(KERN_ERR "happymeal: Cannot map global registers.\n"); dev_err(&op->dev, "Cannot map global registers.\n");
goto err_out_free_netdev; goto err_out_free_netdev;
} }
hp->etxregs = of_ioremap(&op->resource[1], 0, hp->etxregs = of_ioremap(&op->resource[1], 0,
ETX_REG_SIZE, "HME TX Regs"); ETX_REG_SIZE, "HME TX Regs");
if (!hp->etxregs) { if (!hp->etxregs) {
printk(KERN_ERR "happymeal: Cannot map MAC TX registers.\n"); dev_err(&op->dev, "Cannot map MAC TX registers.\n");
goto err_out_iounmap; goto err_out_iounmap;
} }
hp->erxregs = of_ioremap(&op->resource[2], 0, hp->erxregs = of_ioremap(&op->resource[2], 0,
ERX_REG_SIZE, "HME RX Regs"); ERX_REG_SIZE, "HME RX Regs");
if (!hp->erxregs) { if (!hp->erxregs) {
printk(KERN_ERR "happymeal: Cannot map MAC RX registers.\n"); dev_err(&op->dev, "Cannot map MAC RX registers.\n");
goto err_out_iounmap; goto err_out_iounmap;
} }
hp->bigmacregs = of_ioremap(&op->resource[3], 0, hp->bigmacregs = of_ioremap(&op->resource[3], 0,
BMAC_REG_SIZE, "HME BIGMAC Regs"); BMAC_REG_SIZE, "HME BIGMAC Regs");
if (!hp->bigmacregs) { if (!hp->bigmacregs) {
printk(KERN_ERR "happymeal: Cannot map BIGMAC registers.\n"); dev_err(&op->dev, "Cannot map BIGMAC registers.\n");
goto err_out_iounmap; goto err_out_iounmap;
} }
hp->tcvregs = of_ioremap(&op->resource[4], 0, hp->tcvregs = of_ioremap(&op->resource[4], 0,
TCVR_REG_SIZE, "HME Tranceiver Regs"); TCVR_REG_SIZE, "HME Tranceiver Regs");
if (!hp->tcvregs) { if (!hp->tcvregs) {
printk(KERN_ERR "happymeal: Cannot map TCVR registers.\n"); dev_err(&op->dev, "Cannot map TCVR registers.\n");
goto err_out_iounmap; goto err_out_iounmap;
} }
...@@ -2807,21 +2692,19 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe) ...@@ -2807,21 +2692,19 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe)
err = register_netdev(hp->dev); err = register_netdev(hp->dev);
if (err) { if (err) {
printk(KERN_ERR "happymeal: Cannot register net device, " dev_err(&op->dev, "Cannot register net device, aborting.\n");
"aborting.\n");
goto err_out_free_coherent; goto err_out_free_coherent;
} }
platform_set_drvdata(op, hp); platform_set_drvdata(op, hp);
if (qfe_slot != -1) if (qfe_slot != -1)
printk(KERN_INFO "%s: Quattro HME slot %d (SBUS) 10/100baseT Ethernet ", netdev_info(dev,
dev->name, qfe_slot); "Quattro HME slot %d (SBUS) 10/100baseT Ethernet %pM\n",
qfe_slot, dev->dev_addr);
else else
printk(KERN_INFO "%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ", netdev_info(dev, "HAPPY MEAL (SBUS) 10/100baseT Ethernet %pM\n",
dev->name); dev->dev_addr);
printk("%pM\n", dev->dev_addr);
return 0; return 0;
...@@ -2949,7 +2832,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, ...@@ -2949,7 +2832,7 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
struct happy_meal *hp; struct happy_meal *hp;
struct net_device *dev; struct net_device *dev;
void __iomem *hpreg_base; void __iomem *hpreg_base;
unsigned long hpreg_res; struct resource *hpreg_res;
int i, qfe_slot = -1; int i, qfe_slot = -1;
char prom_name[64]; char prom_name[64];
u8 addr[ETH_ALEN]; u8 addr[ETH_ALEN];
...@@ -2966,32 +2849,33 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, ...@@ -2966,32 +2849,33 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
strcpy(prom_name, "SUNW,hme"); strcpy(prom_name, "SUNW,hme");
#endif #endif
err = -ENODEV; err = pcim_enable_device(pdev);
if (err)
if (pci_enable_device(pdev))
goto err_out; goto err_out;
pci_set_master(pdev); pci_set_master(pdev);
if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) { if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) {
qp = quattro_pci_find(pdev); qp = quattro_pci_find(pdev);
if (qp == NULL) if (IS_ERR(qp)) {
err = PTR_ERR(qp);
goto err_out; goto err_out;
}
for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) for (qfe_slot = 0; qfe_slot < 4; qfe_slot++)
if (qp->happy_meals[qfe_slot] == NULL) if (!qp->happy_meals[qfe_slot])
break; break;
if (qfe_slot == 4) if (qfe_slot == 4)
goto err_out; goto err_out;
} }
dev = alloc_etherdev(sizeof(struct happy_meal)); dev = devm_alloc_etherdev(&pdev->dev, sizeof(struct happy_meal));
if (!dev) {
err = -ENOMEM; err = -ENOMEM;
if (!dev)
goto err_out; goto err_out;
}
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
if (hme_version_printed++ == 0)
printk(KERN_INFO "%s", version);
hp = netdev_priv(dev); hp = netdev_priv(dev);
hp->happy_dev = pdev; hp->happy_dev = pdev;
...@@ -3005,21 +2889,26 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, ...@@ -3005,21 +2889,26 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
qp->happy_meals[qfe_slot] = dev; qp->happy_meals[qfe_slot] = dev;
} }
hpreg_res = pci_resource_start(pdev, 0); err = -EINVAL;
err = -ENODEV;
if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) { if ((pci_resource_flags(pdev, 0) & IORESOURCE_IO) != 0) {
printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n"); dev_err(&pdev->dev,
"Cannot find proper PCI device base address.\n");
goto err_out_clear_quattro; goto err_out_clear_quattro;
} }
if (pci_request_regions(pdev, DRV_NAME)) {
printk(KERN_ERR "happymeal(PCI): Cannot obtain PCI resources, " hpreg_res = devm_request_region(&pdev->dev, pci_resource_start(pdev, 0),
"aborting.\n"); pci_resource_len(pdev, 0), DRV_NAME);
if (IS_ERR(hpreg_res)) {
err = PTR_ERR(hpreg_res);
dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
goto err_out_clear_quattro; goto err_out_clear_quattro;
} }
if ((hpreg_base = ioremap(hpreg_res, 0x8000)) == NULL) { hpreg_base = pcim_iomap(pdev, 0, 0x8000);
printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n"); if (!hpreg_base) {
goto err_out_free_res; err = -ENOMEM;
dev_err(&pdev->dev, "Unable to remap card memory.\n");
goto err_out_clear_quattro;
} }
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
...@@ -3085,11 +2974,12 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, ...@@ -3085,11 +2974,12 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
hp->happy_bursts = DMA_BURSTBITS; hp->happy_bursts = DMA_BURSTBITS;
#endif #endif
hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, hp->happy_block = dmam_alloc_coherent(&pdev->dev, PAGE_SIZE,
&hp->hblock_dvma, GFP_KERNEL); &hp->hblock_dvma, GFP_KERNEL);
err = -ENODEV; if (!hp->happy_block) {
if (!hp->happy_block) err = -ENOMEM;
goto err_out_iounmap; goto err_out_clear_quattro;
}
hp->linkcheck = 0; hp->linkcheck = 0;
hp->timer_state = asleep; hp->timer_state = asleep;
...@@ -3123,11 +3013,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, ...@@ -3123,11 +3013,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
happy_meal_set_initial_advertisement(hp); happy_meal_set_initial_advertisement(hp);
spin_unlock_irq(&hp->happy_lock); spin_unlock_irq(&hp->happy_lock);
err = register_netdev(hp->dev); err = devm_register_netdev(&pdev->dev, dev);
if (err) { if (err) {
printk(KERN_ERR "happymeal(PCI): Cannot register net device, " dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
"aborting.\n"); goto err_out_clear_quattro;
goto err_out_free_coherent;
} }
pci_set_drvdata(pdev, hp); pci_set_drvdata(pdev, hp);
...@@ -3140,61 +3029,30 @@ static int happy_meal_pci_probe(struct pci_dev *pdev, ...@@ -3140,61 +3029,30 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
int i = simple_strtoul(dev->name + 3, NULL, 10); int i = simple_strtoul(dev->name + 3, NULL, 10);
sprintf(prom_name, "-%d", i + 3); sprintf(prom_name, "-%d", i + 3);
} }
printk(KERN_INFO "%s%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet ", dev->name, prom_name); netdev_info(dev,
if (qpdev->vendor == PCI_VENDOR_ID_DEC && "%s: Quattro HME (PCI/CheerIO) 10/100baseT Ethernet bridge %04x.%04x\n",
qpdev->device == PCI_DEVICE_ID_DEC_21153) prom_name, qpdev->vendor, qpdev->device);
printk("DEC 21153 PCI Bridge\n");
else
printk("unknown bridge %04x.%04x\n",
qpdev->vendor, qpdev->device);
} }
if (qfe_slot != -1) if (qfe_slot != -1)
printk(KERN_INFO "%s: Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet ", netdev_info(dev,
dev->name, qfe_slot); "Quattro HME slot %d (PCI/CheerIO) 10/100baseT Ethernet %pM\n",
qfe_slot, dev->dev_addr);
else else
printk(KERN_INFO "%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ", netdev_info(dev,
dev->name); "HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet %pM\n",
dev->dev_addr);
printk("%pM\n", dev->dev_addr);
return 0; return 0;
err_out_free_coherent:
dma_free_coherent(hp->dma_dev, PAGE_SIZE,
hp->happy_block, hp->hblock_dvma);
err_out_iounmap:
iounmap(hp->gregs);
err_out_free_res:
pci_release_regions(pdev);
err_out_clear_quattro: err_out_clear_quattro:
if (qp != NULL) if (qp != NULL)
qp->happy_meals[qfe_slot] = NULL; qp->happy_meals[qfe_slot] = NULL;
free_netdev(dev);
err_out: err_out:
return err; return err;
} }
static void happy_meal_pci_remove(struct pci_dev *pdev)
{
struct happy_meal *hp = pci_get_drvdata(pdev);
struct net_device *net_dev = hp->dev;
unregister_netdev(net_dev);
dma_free_coherent(hp->dma_dev, PAGE_SIZE,
hp->happy_block, hp->hblock_dvma);
iounmap(hp->gregs);
pci_release_regions(hp->happy_dev);
free_netdev(net_dev);
}
static const struct pci_device_id happymeal_pci_ids[] = { static const struct pci_device_id happymeal_pci_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) }, { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) },
{ } /* Terminating entry */ { } /* Terminating entry */
...@@ -3206,7 +3064,6 @@ static struct pci_driver hme_pci_driver = { ...@@ -3206,7 +3064,6 @@ static struct pci_driver hme_pci_driver = {
.name = "hme", .name = "hme",
.id_table = happymeal_pci_ids, .id_table = happymeal_pci_ids,
.probe = happy_meal_pci_probe, .probe = happy_meal_pci_probe,
.remove = happy_meal_pci_remove,
}; };
static int __init happy_meal_pci_init(void) static int __init happy_meal_pci_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment