#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
+#include <linux/bitops.h>
#include <asm/auxio.h>
-#include <asm/bitops.h>
#include <asm/byteorder.h>
#include <asm/dma.h>
#include <asm/idprom.h>
#include "sunbmac.h"
+#define DRV_NAME "sunbmac"
+#define DRV_VERSION "2.0"
+#define DRV_RELDATE "11/24/03"
+#define DRV_AUTHOR "David S. Miller (davem@redhat.com)"
+
static char version[] __initdata =
- "sunbmac.c:v2.0 24/Nov/03 David S. Miller (davem@redhat.com)\n";
+ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n";
+
+MODULE_VERSION(DRV_VERSION);
+MODULE_AUTHOR(DRV_AUTHOR);
+MODULE_DESCRIPTION("Sun BigMAC 100baseT ethernet driver");
+MODULE_LICENSE("GPL");
#undef DEBUG_PROBE
#undef DEBUG_TX
#define QEC_RESET_TRIES 200
-static int qec_global_reset(unsigned long gregs)
+static int qec_global_reset(void __iomem *gregs)
{
int tries = QEC_RESET_TRIES;
static void qec_init(struct bigmac *bp)
{
- unsigned long gregs = bp->gregs;
+ void __iomem *gregs = bp->gregs;
struct sbus_dev *qec_sdev = bp->qec_sdev;
u8 bsizes = bp->bigmac_bursts;
u32 regval;
#define TX_RESET_TRIES 32
#define RX_RESET_TRIES 32
-static void bigmac_tx_reset(unsigned long bregs)
+static void bigmac_tx_reset(void __iomem *bregs)
{
int tries = TX_RESET_TRIES;
}
}
-static void bigmac_rx_reset(unsigned long bregs)
+static void bigmac_rx_reset(void __iomem *bregs)
{
int tries = RX_RESET_TRIES;
bigmac_rx_reset(bp->bregs);
}
-static void bigmac_get_counters(struct bigmac *bp, unsigned long bregs)
+static void bigmac_get_counters(struct bigmac *bp, void __iomem *bregs)
{
struct net_device_stats *stats = &bp->enet_stats;
{
struct bmac_init_block *bb = bp->bmac_block;
struct net_device *dev = bp->dev;
- int i, gfp_flags = GFP_KERNEL;
+ int i;
+ gfp_t gfp_flags = GFP_KERNEL;
if (from_irq || in_interrupt())
gfp_flags = GFP_ATOMIC;
#define MGMT_CLKON (MGMT_PAL_INT_MDIO|MGMT_PAL_EXT_MDIO|MGMT_PAL_OENAB|MGMT_PAL_DCLOCK)
#define MGMT_CLKOFF (MGMT_PAL_INT_MDIO|MGMT_PAL_EXT_MDIO|MGMT_PAL_OENAB)
-static void idle_transceiver(unsigned long tregs)
+static void idle_transceiver(void __iomem *tregs)
{
int i = 20;
}
}
-static void write_tcvr_bit(struct bigmac *bp, unsigned long tregs, int bit)
+static void write_tcvr_bit(struct bigmac *bp, void __iomem *tregs, int bit)
{
if (bp->tcvr_type == internal) {
bit = (bit & 1) << 3;
}
}
-static int read_tcvr_bit(struct bigmac *bp, unsigned long tregs)
+static int read_tcvr_bit(struct bigmac *bp, void __iomem *tregs)
{
int retval = 0;
return retval;
}
-static int read_tcvr_bit2(struct bigmac *bp, unsigned long tregs)
+static int read_tcvr_bit2(struct bigmac *bp, void __iomem *tregs)
{
int retval = 0;
}
static void put_tcvr_byte(struct bigmac *bp,
- unsigned long tregs,
+ void __iomem *tregs,
unsigned int byte)
{
int shift = 4;
} while (shift >= 0);
}
-static void bigmac_tcvr_write(struct bigmac *bp, unsigned long tregs,
+static void bigmac_tcvr_write(struct bigmac *bp, void __iomem *tregs,
int reg, unsigned short val)
{
int shift;
}
static unsigned short bigmac_tcvr_read(struct bigmac *bp,
- unsigned long tregs,
+ void __iomem *tregs,
int reg)
{
unsigned short retval = 0;
static void bigmac_tcvr_init(struct bigmac *bp)
{
- unsigned long tregs = bp->tregs;
+ void __iomem *tregs = bp->tregs;
u32 mpal;
idle_transceiver(tregs);
static int bigmac_init(struct bigmac *, int);
-static int try_next_permutation(struct bigmac *bp, unsigned long tregs)
+static int try_next_permutation(struct bigmac *bp, void __iomem *tregs)
{
if (bp->sw_bmcr & BMCR_SPEED100) {
int timeout;
static void bigmac_timer(unsigned long data)
{
struct bigmac *bp = (struct bigmac *) data;
- unsigned long tregs = bp->tregs;
+ void __iomem *tregs = bp->tregs;
int restart_timer = 0;
bp->timer_ticks++;
*/
static void bigmac_begin_auto_negotiation(struct bigmac *bp)
{
- unsigned long tregs = bp->tregs;
+ void __iomem *tregs = bp->tregs;
int timeout;
/* Grab new software copies of PHY registers. */
static int bigmac_init(struct bigmac *bp, int from_irq)
{
- unsigned long gregs = bp->gregs;
- unsigned long cregs = bp->creg;
- unsigned long bregs = bp->bregs;
+ void __iomem *gregs = bp->gregs;
+ void __iomem *cregs = bp->creg;
+ void __iomem *bregs = bp->bregs;
unsigned char *e = &bp->dev->dev_addr[0];
/* Latch current counters into statistics. */
static void bigmac_set_multicast(struct net_device *dev)
{
struct bigmac *bp = (struct bigmac *) dev->priv;
- unsigned long bregs = bp->bregs;
+ void __iomem *bregs = bp->bregs;
struct dev_mc_list *dmi = dev->mc_list;
char *addrs;
int i;
module_init(bigmac_probe);
module_exit(bigmac_cleanup);
-MODULE_LICENSE("GPL");