Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322741
b: refs/heads/master
c: b320e97
h: refs/heads/master
i:
  322739: e16d8db
v: v3
  • Loading branch information
Wu Fengguang authored and David S. Miller committed Sep 4, 2012
1 parent 2027131 commit 836614c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b59df46a449ec9975146d71318c4777ad086744
refs/heads/master: b320e97240de0f98b81f866d59f47af41780eab0
13 changes: 9 additions & 4 deletions trunk/drivers/net/ethernet/i825xx/znet.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ struct znet_private {
/* Only one can be built-in;-> */
static struct net_device *znet_dev;

#define NETIDBLK_MAGIC "NETIDBLK"
#define NETIDBLK_MAGIC_SIZE 8

struct netidblk {
char magic[8]; /* The magic number (string) "NETIDBLK" */
char magic[NETIDBLK_MAGIC_SIZE]; /* The magic number (string) "NETIDBLK" */
unsigned char netid[8]; /* The physical station address */
char nettype, globalopt;
char vendor[8]; /* The machine vendor and product name. */
Expand Down Expand Up @@ -373,14 +376,16 @@ static int __init znet_probe (void)
struct znet_private *znet;
struct net_device *dev;
char *p;
char *plast = phys_to_virt(0x100000 - NETIDBLK_MAGIC_SIZE);
int err = -ENOMEM;

/* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */
for(p = (char *)phys_to_virt(0xf0000); p < (char *)phys_to_virt(0x100000); p++)
if (*p == 'N' && strncmp(p, "NETIDBLK", 8) == 0)
for(p = (char *)phys_to_virt(0xf0000); p <= plast; p++)
if (*p == 'N' &&
strncmp(p, NETIDBLK_MAGIC, NETIDBLK_MAGIC_SIZE) == 0)
break;

if (p >= (char *)phys_to_virt(0x100000)) {
if (p > plast) {
if (znet_debug > 1)
printk(KERN_INFO "No Z-Note ethernet adaptor found.\n");
return -ENODEV;
Expand Down

0 comments on commit 836614c

Please sign in to comment.