Commit f73dea10 authored by Alexander Viro's avatar Alexander Viro Committed by Jeff Garzik

[PATCH] net/pcmcia iomem annotations

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
parent c0d148cd
......@@ -623,7 +623,7 @@ static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id)
{
win_req_t req;
memreq_t mem;
u_char *base;
u_char __iomem *base;
int i, j;
/* Allocate a small memory window */
......@@ -676,7 +676,7 @@ static int fmvj18x_setup_mfc(dev_link_t *link)
{
win_req_t req;
memreq_t mem;
u_char *base;
u_char __iomem *base;
int i, j;
struct net_device *dev = link->priv;
ioaddr_t ioaddr;
......
......@@ -227,7 +227,7 @@ typedef struct pcnet_dev_t {
dev_link_t link;
dev_node_t node;
u_int flags;
caddr_t base;
void __iomem *base;
struct timer_list watchdog;
int stale, fast_poll;
u_char phy_id;
......@@ -352,7 +352,7 @@ static hw_info_t *get_hwinfo(dev_link_t *link)
struct net_device *dev = link->priv;
win_req_t req;
memreq_t mem;
u_char *base, *virt;
u_char __iomem *base, *virt;
int i, j;
/* Allocate a small memory window */
......@@ -1491,9 +1491,10 @@ static int setup_dma_config(dev_link_t *link, int start_pg,
/*====================================================================*/
static void copyin(u_char *dest, u_char *src, int c)
static void copyin(void *dest, void __iomem *src, int c)
{
u_short *d = (u_short *)dest, *s = (u_short *)src;
u_short *d = dest;
u_short __iomem *s = src;
int odd;
if (c <= 0)
......@@ -1508,9 +1509,10 @@ static void copyin(u_char *dest, u_char *src, int c)
*((u_char *)d) = readw(s) & 0xff;
}
static void copyout(u_char *dest, const u_char *src, int c)
static void copyout(void __iomem *dest, const void *src, int c)
{
u_short *d = (u_short *)dest, *s = (u_short *)src;
u_short __iomem *d = dest;
const u_short *s = src;
int odd;
if (c <= 0)
......@@ -1531,10 +1533,11 @@ static void shmem_get_8390_hdr(struct net_device *dev,
struct e8390_pkt_hdr *hdr,
int ring_page)
{
void *xfer_start = (void *)(ei_status.rmem_start + (ring_page << 8)
- (ei_status.rx_start_page << 8));
void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8)
+ (ring_page << 8)
- (ei_status.rx_start_page << 8);
copyin((void *)hdr, xfer_start, sizeof(struct e8390_pkt_hdr));
copyin(hdr, xfer_start, sizeof(struct e8390_pkt_hdr));
/* Fix for big endian systems */
hdr->count = le16_to_cpu(hdr->count);
}
......@@ -1544,17 +1547,17 @@ static void shmem_get_8390_hdr(struct net_device *dev,
static void shmem_block_input(struct net_device *dev, int count,
struct sk_buff *skb, int ring_offset)
{
void *xfer_start = (void *)(ei_status.rmem_start + ring_offset
- (ei_status.rx_start_page << 8));
void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8)
+ ring_offset
- (ei_status.rx_start_page << 8);
char *buf = skb->data;
if (xfer_start + count > (void *)ei_status.rmem_end) {
if (xfer_start + count > (void __iomem *)ei_status.rmem_end) {
/* We must wrap the input move. */
int semi_count = (void*)ei_status.rmem_end - xfer_start;
int semi_count = (void __iomem *)ei_status.rmem_end - xfer_start;
copyin(buf, xfer_start, semi_count);
buf += semi_count;
ring_offset = ei_status.rx_start_page << 8;
xfer_start = (void *)ei_status.rmem_start;
xfer_start = ei_status.mem + (TX_PAGES<<8);
count -= semi_count;
}
copyin(buf, xfer_start, count);
......@@ -1565,7 +1568,7 @@ static void shmem_block_input(struct net_device *dev, int count,
static void shmem_block_output(struct net_device *dev, int count,
const u_char *buf, const int start_page)
{
void *shmem = (void *)dev->mem_start + (start_page << 8);
void __iomem *shmem = ei_status.mem + (start_page << 8);
shmem -= ei_status.tx_start_page << 8;
copyout(shmem, buf, count);
}
......@@ -1617,8 +1620,8 @@ static int setup_shmem_window(dev_link_t *link, int start_pg,
goto failed;
}
dev->mem_start = (u_long)info->base + offset;
ei_status.rmem_start = dev->mem_start + (TX_PAGES<<8);
ei_status.mem = info->base + offset;
dev->mem_start = (u_long)ei_status.mem;
dev->mem_end = ei_status.rmem_end = (u_long)info->base + req.Size;
ei_status.tx_start_page = start_pg;
......
......@@ -120,7 +120,7 @@ struct smc_private {
dev_node_t node;
struct sk_buff *saved_skb;
int packets_waiting;
caddr_t base;
void __iomem *base;
u_short cfg;
struct timer_list media;
int watchdog, tx_err;
......
......@@ -365,7 +365,7 @@ typedef struct local_info_t {
int dingo; /* a CEM56 type card */
int new_mii; /* has full 10baseT/100baseT MII */
int modem; /* is a multi function card (i.e with a modem) */
caddr_t dingo_ccr; /* only used for CEM56 cards */
void __iomem *dingo_ccr; /* only used for CEM56 cards */
unsigned last_ptr_value; /* last packets transmitted value */
const char *manf_str;
} local_info_t;
......
......@@ -76,67 +76,54 @@ static inline void copy_user_to_pc(void *to, const void *from, size_t n)
#else /* UNSAFE_MEMCPY */
static inline void copy_from_pc(void *to, const void *from, size_t n)
static inline void copy_from_pc(void *to, void __iomem *from, size_t n)
{
size_t odd = (n & 1);
n -= odd;
while (n) {
u_short *t = to;
*t = __raw_readw(from);
to = (void *)((long)to + 2);
from = (const void *)((long)from + 2);
n -= 2;
}
if (odd)
*(u_char *)to = readb(from);
__u16 *t = to;
__u16 __iomem *f = from;
size_t odd = (n & 1);
for (n >>= 1; n; n--)
*t++ = __raw_readw(f++);
if (odd)
*(__u8 *)t = readb(f);
}
static inline void copy_to_pc(void *to, const void *from, size_t n)
static inline void copy_to_pc(void __iomem *to, const void *from, size_t n)
{
size_t odd = (n & 1);
n -= odd;
while (n) {
__raw_writew(*(u_short *)from, to);
to = (void *)((long)to + 2);
from = (const void *)((long)from + 2);
n -= 2;
}
if (odd)
writeb(*(u_char *)from, to);
__u16 __iomem *t = to;
const __u16 *f = from;
size_t odd = (n & 1);
for (n >>= 1; n ; n--)
__raw_writew(*f++, t++);
if (odd)
writeb(*(__u8 *)f, t);
}
static inline void copy_pc_to_user(void *to, const void *from, size_t n)
static inline void copy_pc_to_user(void __user *to, void __iomem *from, size_t n)
{
size_t odd = (n & 1);
n -= odd;
while (n) {
put_user(__raw_readw(from), (short *)to);
to = (void *)((long)to + 2);
from = (const void *)((long)from + 2);
n -= 2;
}
if (odd)
put_user(readb(from), (char *)to);
__u16 __user *t = to;
__u16 __iomem *f = from;
size_t odd = (n & 1);
for (n >>= 1; n ; n--)
put_user(__raw_readw(f++), t++);
if (odd)
put_user(readb(f), (char __user *)t);
}
static inline void copy_user_to_pc(void *to, const void *from, size_t n)
static inline void copy_user_to_pc(void __iomem *to, void __user *from, size_t n)
{
short s;
char c;
size_t odd = (n & 1);
n -= odd;
while (n) {
get_user(s, (short *)from);
__raw_writew(s, to);
to = (void *)((long)to + 2);
from = (const void *)((long)from + 2);
n -= 2;
}
if (odd) {
get_user(c, (char *)from);
writeb(c, to);
}
__u16 __user *f = from;
__u16 __iomem *t = to;
short s;
char c;
size_t odd = (n & 1);
for (n >>= 1; n; n--) {
get_user(s, f++);
__raw_writew(s, t++);
}
if (odd) {
get_user(c, (char __user *)f);
writeb(c, t);
}
}
#endif /* UNSAFE_MEMCPY */
......
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