diff options
Diffstat (limited to 'drivers/net/ethernet/i825xx/znet.c')
| -rw-r--r-- | drivers/net/ethernet/i825xx/znet.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/ethernet/i825xx/znet.c b/drivers/net/ethernet/i825xx/znet.c index bd1f1ef91e19..ba4e0cea3506 100644 --- a/drivers/net/ethernet/i825xx/znet.c +++ b/drivers/net/ethernet/i825xx/znet.c | |||
| @@ -139,8 +139,11 @@ struct znet_private { | |||
| 139 | /* Only one can be built-in;-> */ | 139 | /* Only one can be built-in;-> */ |
| 140 | static struct net_device *znet_dev; | 140 | static struct net_device *znet_dev; |
| 141 | 141 | ||
| 142 | #define NETIDBLK_MAGIC "NETIDBLK" | ||
| 143 | #define NETIDBLK_MAGIC_SIZE 8 | ||
| 144 | |||
| 142 | struct netidblk { | 145 | struct netidblk { |
| 143 | char magic[8]; /* The magic number (string) "NETIDBLK" */ | 146 | char magic[NETIDBLK_MAGIC_SIZE]; /* The magic number (string) "NETIDBLK" */ |
| 144 | unsigned char netid[8]; /* The physical station address */ | 147 | unsigned char netid[8]; /* The physical station address */ |
| 145 | char nettype, globalopt; | 148 | char nettype, globalopt; |
| 146 | char vendor[8]; /* The machine vendor and product name. */ | 149 | char vendor[8]; /* The machine vendor and product name. */ |
| @@ -373,14 +376,16 @@ static int __init znet_probe (void) | |||
| 373 | struct znet_private *znet; | 376 | struct znet_private *znet; |
| 374 | struct net_device *dev; | 377 | struct net_device *dev; |
| 375 | char *p; | 378 | char *p; |
| 379 | char *plast = phys_to_virt(0x100000 - NETIDBLK_MAGIC_SIZE); | ||
| 376 | int err = -ENOMEM; | 380 | int err = -ENOMEM; |
| 377 | 381 | ||
| 378 | /* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */ | 382 | /* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */ |
| 379 | for(p = (char *)phys_to_virt(0xf0000); p < (char *)phys_to_virt(0x100000); p++) | 383 | for(p = (char *)phys_to_virt(0xf0000); p <= plast; p++) |
| 380 | if (*p == 'N' && strncmp(p, "NETIDBLK", 8) == 0) | 384 | if (*p == 'N' && |
| 385 | strncmp(p, NETIDBLK_MAGIC, NETIDBLK_MAGIC_SIZE) == 0) | ||
| 381 | break; | 386 | break; |
| 382 | 387 | ||
| 383 | if (p >= (char *)phys_to_virt(0x100000)) { | 388 | if (p > plast) { |
| 384 | if (znet_debug > 1) | 389 | if (znet_debug > 1) |
| 385 | printk(KERN_INFO "No Z-Note ethernet adaptor found.\n"); | 390 | printk(KERN_INFO "No Z-Note ethernet adaptor found.\n"); |
| 386 | return -ENODEV; | 391 | return -ENODEV; |
