lkml.org 
[lkml]   [2000]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] change ifmap.base_addr to u_long type

Linus,

Here is a small patch which is needed on non-i386 platforms.

base_addr in ifmap allows one to specify as a kernel boot argument the
base io addr of the net device. It is currently defined as u_short.
However, on a non-i386 platforms, this addr can be greater than what
u_short can represent.

ifmap.base_addr is mainly used to initialize net_device base_addr, which
is already a u_long.

This change does not increase the memory size for struct ifmap.

In the same spirit, ifmap.irq should probably be changed to u_int as
well, but that would increase the size, and I don't have the need yet.
:-)

Jundiff -Nru linux/include/linux/if.h.orig linux/include/linux/if.h
--- linux/include/linux/if.h.orig Thu Sep 7 14:20:47 2000
+++ linux/include/linux/if.h Thu Sep 7 14:24:06 2000
@@ -59,11 +59,11 @@
{
unsigned long mem_start;
unsigned long mem_end;
- unsigned short base_addr;
+ unsigned long base_addr;
unsigned char irq;
unsigned char dma;
unsigned char port;
- /* 3 bytes spare */
+ /* 1 byte spare */
};

/*
diff -Nru linux/drivers/net/net_init.c.orig linux/drivers/net/net_init.c
--- linux/drivers/net/net_init.c.orig Thu Sep 7 14:20:55 2000
+++ linux/drivers/net/net_init.c Thu Sep 7 14:21:41 2000
@@ -397,7 +397,7 @@
dev->mem_start = map->mem_start;
if (map->mem_end != (u_long)(-1))
dev->mem_end = map->mem_end;
- if (map->base_addr != (u_short)(-1))
+ if (map->base_addr != (u_long)(-1))
dev->base_addr = map->base_addr;
if (map->irq != (u_char)(-1))
dev->irq = map->irq;
\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.044 / U:0.624 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site