Commit d977939f authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/bk/26-latest-ref

into intel.com:/home/lenb/src/26-latest-dev
parents 2bac69cf cb281c89
...@@ -593,6 +593,12 @@ proc_types: ...@@ -593,6 +593,12 @@ proc_types:
b __armv4_cache_off b __armv4_cache_off
b __armv4_cache_flush b __armv4_cache_flush
.word 0x00070000 @ ARMv6
.word 0x000f0000
b __armv4_cache_on
b __armv4_cache_off
b __armv6_cache_flush
.word 0 @ unrecognised type .word 0 @ unrecognised type
.word 0 .word 0
mov pc, lr mov pc, lr
...@@ -652,6 +658,14 @@ cache_clean_flush: ...@@ -652,6 +658,14 @@ cache_clean_flush:
mov r3, #16 mov r3, #16
b call_cache_fn b call_cache_fn
__armv6_cache_flush:
mov r1, #0
mcr p15, 0, r1, c7, c14, 0 @ clean+invalidate D
mcr p15, 0, r1, c7, c5, 0 @ invalidate I+BTB
mcr p15, 0, r1, c7, c15, 0 @ clean+invalidate unified
mcr p15, 0, r1, c7, c10, 4 @ drain WB
mov pc, lr
__armv4_cache_flush: __armv4_cache_flush:
mov r2, #64*1024 @ default: 32K dcache size (*2) mov r2, #64*1024 @ default: 32K dcache size (*2)
mov r11, #32 @ default: 32 byte line size mov r11, #32 @ default: 32 byte line size
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/completion.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -53,18 +54,14 @@ ...@@ -53,18 +54,14 @@
#define HAVE_EXPMASK #define HAVE_EXPMASK
#endif #endif
enum req {
req_readbytes,
req_reset
};
struct ecard_request { struct ecard_request {
enum req req; void (*fn)(struct ecard_request *);
ecard_t *ec; ecard_t *ec;
unsigned int address; unsigned int address;
unsigned int length; unsigned int length;
unsigned int use_loader; unsigned int use_loader;
void *buffer; void *buffer;
struct completion *complete;
}; };
struct expcard_blacklist { struct expcard_blacklist {
...@@ -129,15 +126,14 @@ slot_to_ecard(unsigned int slot) ...@@ -129,15 +126,14 @@ slot_to_ecard(unsigned int slot)
#define POD_INT_ADDR(x) ((volatile unsigned char *)\ #define POD_INT_ADDR(x) ((volatile unsigned char *)\
((BUS_ADDR((x)) - IO_BASE) + IO_START)) ((BUS_ADDR((x)) - IO_BASE) + IO_START))
static inline void ecard_task_reset(struct ecard_request *req) static void ecard_task_reset(struct ecard_request *req)
{ {
struct expansion_card *ec = req->ec; struct expansion_card *ec = req->ec;
if (ec->loader) if (ec->loader)
ecard_loader_reset(POD_INT_ADDR(ec->podaddr), ec->loader); ecard_loader_reset(POD_INT_ADDR(ec->podaddr), ec->loader);
} }
static void static void ecard_task_readbytes(struct ecard_request *req)
ecard_task_readbytes(struct ecard_request *req)
{ {
unsigned char *buf = (unsigned char *)req->buffer; unsigned char *buf = (unsigned char *)req->buffer;
volatile unsigned char *base_addr = volatile unsigned char *base_addr =
...@@ -206,26 +202,9 @@ ecard_task_readbytes(struct ecard_request *req) ...@@ -206,26 +202,9 @@ ecard_task_readbytes(struct ecard_request *req)
} }
static void ecard_do_request(struct ecard_request *req) static DECLARE_WAIT_QUEUE_HEAD(ecard_wait);
{
switch (req->req) {
case req_readbytes:
ecard_task_readbytes(req);
break;
case req_reset:
ecard_task_reset(req);
break;
}
}
#include <linux/completion.h>
static pid_t ecard_pid;
static wait_queue_head_t ecard_wait;
static struct ecard_request *ecard_req; static struct ecard_request *ecard_req;
static DECLARE_MUTEX(ecard_sem); static DECLARE_MUTEX(ecard_sem);
static DECLARE_COMPLETION(ecard_completion);
/* /*
* Set up the expansion card daemon's page tables. * Set up the expansion card daemon's page tables.
...@@ -299,9 +278,10 @@ ecard_task(void * unused) ...@@ -299,9 +278,10 @@ ecard_task(void * unused)
wait_event_interruptible(ecard_wait, ecard_req != NULL); wait_event_interruptible(ecard_wait, ecard_req != NULL);
req = xchg(&ecard_req, NULL); req = xchg(&ecard_req, NULL);
if (req != NULL) if (req != NULL) {
ecard_do_request(req); req->fn(req);
complete(&ecard_completion); complete(req->complete);
}
} }
} }
...@@ -311,17 +291,11 @@ ecard_task(void * unused) ...@@ -311,17 +291,11 @@ ecard_task(void * unused)
* FIXME: The test here is not sufficient to detect if the * FIXME: The test here is not sufficient to detect if the
* kcardd is running. * kcardd is running.
*/ */
static void static void ecard_call(struct ecard_request *req)
ecard_call(struct ecard_request *req)
{ {
/* DECLARE_COMPLETION(completion);
* Make sure we have a context that is able to sleep.
*/
if (current == &init_task || in_interrupt())
BUG();
if (ecard_pid <= 0) req->complete = &completion;
ecard_pid = kernel_thread(ecard_task, NULL, CLONE_KERNEL);
down(&ecard_sem); down(&ecard_sem);
ecard_req = req; ecard_req = req;
...@@ -330,7 +304,7 @@ ecard_call(struct ecard_request *req) ...@@ -330,7 +304,7 @@ ecard_call(struct ecard_request *req)
/* /*
* Now wait for kecardd to run. * Now wait for kecardd to run.
*/ */
wait_for_completion(&ecard_completion); wait_for_completion(&completion);
up(&ecard_sem); up(&ecard_sem);
} }
...@@ -341,7 +315,7 @@ ecard_readbytes(void *addr, ecard_t *ec, int off, int len, int useld) ...@@ -341,7 +315,7 @@ ecard_readbytes(void *addr, ecard_t *ec, int off, int len, int useld)
{ {
struct ecard_request req; struct ecard_request req;
req.req = req_readbytes; req.fn = ecard_task_readbytes;
req.ec = ec; req.ec = ec;
req.address = off; req.address = off;
req.length = len; req.length = len;
...@@ -1061,9 +1035,14 @@ ecard_probe(int slot, card_type_t type) ...@@ -1061,9 +1035,14 @@ ecard_probe(int slot, card_type_t type)
*/ */
static int __init ecard_init(void) static int __init ecard_init(void)
{ {
int slot, irqhw; int slot, irqhw, ret;
init_waitqueue_head(&ecard_wait); ret = kernel_thread(ecard_task, NULL, CLONE_KERNEL);
if (ret < 0) {
printk(KERN_ERR "Ecard: unable to create kernel thread: %d\n",
ret);
return ret;
}
printk("Probing expansion cards\n"); printk("Probing expansion cards\n");
...@@ -1146,7 +1125,7 @@ static void ecard_drv_shutdown(struct device *dev) ...@@ -1146,7 +1125,7 @@ static void ecard_drv_shutdown(struct device *dev)
if (drv->shutdown) if (drv->shutdown)
drv->shutdown(ec); drv->shutdown(ec);
ecard_release(ec); ecard_release(ec);
req.req = req_reset; req.fn = ecard_task_reset;
req.ec = ec; req.ec = ec;
ecard_call(&req); ecard_call(&req);
} }
......
...@@ -189,12 +189,10 @@ cpu_v6_name: ...@@ -189,12 +189,10 @@ cpu_v6_name:
* - cache type register is implemented * - cache type register is implemented
*/ */
__v6_setup: __v6_setup:
mrc p15, 0, r10, c0, c0, 1 @ read cache type register
tst r10, #1 << 24 @ Harvard cache?
mov r10, #0 mov r10, #0
mcrne p15, 0, r10, c7, c14, 0 @ clean+invalidate D cache mcr p15, 0, r10, c7, c14, 0 @ clean+invalidate D cache
mcrne p15, 0, r10, c7, c5, 0 @ invalidate I cache mcr p15, 0, r10, c7, c5, 0 @ invalidate I cache
mcreq p15, 0, r10, c7, c15, 0 @ clean+invalidate cache mcr p15, 0, r10, c7, c15, 0 @ clean+invalidate cache
mcr p15, 0, r10, c7, c10, 4 @ drain write buffer mcr p15, 0, r10, c7, c10, 4 @ drain write buffer
mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs
mcr p15, 0, r10, c2, c0, 2 @ TTB control register mcr p15, 0, r10, c2, c0, 2 @ TTB control register
......
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
#include <pcmcia/ds.h> #include <pcmcia/ds.h>
#include <pcmcia/mem_op.h> #include <pcmcia/mem_op.h>
#ifdef CONFIG_NET_PCMCIA_RADIO
#include <linux/wireless.h> #include <linux/wireless.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -68,7 +67,6 @@ ...@@ -68,7 +67,6 @@
typedef struct iw_statistics iw_stats; typedef struct iw_statistics iw_stats;
typedef struct iw_quality iw_qual; typedef struct iw_quality iw_qual;
typedef u_char mac_addr[ETH_ALEN]; /* Hardware address */ typedef u_char mac_addr[ETH_ALEN]; /* Hardware address */
#endif /* CONFIG_NET_PCMCIA_RADIO */
#include "rayctl.h" #include "rayctl.h"
#include "ray_cs.h" #include "ray_cs.h"
...@@ -112,9 +110,9 @@ static int ray_open(struct net_device *dev); ...@@ -112,9 +110,9 @@ static int ray_open(struct net_device *dev);
static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev); static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev);
static void set_multicast_list(struct net_device *dev); static void set_multicast_list(struct net_device *dev);
static void ray_update_multi_list(struct net_device *dev, int all); static void ray_update_multi_list(struct net_device *dev, int all);
static int translate_frame(ray_dev_t *local, struct tx_msg *ptx, static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx,
unsigned char *data, int len); unsigned char *data, int len);
static void ray_build_header(ray_dev_t *local, struct tx_msg *ptx, UCHAR msg_type, static void ray_build_header(ray_dev_t *local, struct tx_msg __iomem *ptx, UCHAR msg_type,
unsigned char *data); unsigned char *data);
static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len); static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len);
#if WIRELESS_EXT > 7 /* If wireless extension exist in the kernel */ #if WIRELESS_EXT > 7 /* If wireless extension exist in the kernel */
...@@ -140,14 +138,14 @@ static void verify_dl_startup(u_long); ...@@ -140,14 +138,14 @@ static void verify_dl_startup(u_long);
/* Prototypes for interrpt time functions **********************************/ /* Prototypes for interrpt time functions **********************************/
static irqreturn_t ray_interrupt (int reg, void *dev_id, struct pt_regs *regs); static irqreturn_t ray_interrupt (int reg, void *dev_id, struct pt_regs *regs);
static void clear_interrupt(ray_dev_t *local); static void clear_interrupt(ray_dev_t *local);
static void rx_deauthenticate(ray_dev_t *local, struct rcs *prcs, static void rx_deauthenticate(ray_dev_t *local, struct rcs __iomem *prcs,
unsigned int pkt_addr, int rx_len); unsigned int pkt_addr, int rx_len);
static int copy_from_rx_buff(ray_dev_t *local, UCHAR *dest, int pkt_addr, int len); static int copy_from_rx_buff(ray_dev_t *local, UCHAR *dest, int pkt_addr, int len);
static void ray_rx(struct net_device *dev, ray_dev_t *local, struct rcs *prcs); static void ray_rx(struct net_device *dev, ray_dev_t *local, struct rcs __iomem *prcs);
static void release_frag_chain(ray_dev_t *local, struct rcs *prcs); static void release_frag_chain(ray_dev_t *local, struct rcs __iomem *prcs);
static void rx_authenticate(ray_dev_t *local, struct rcs *prcs, static void rx_authenticate(ray_dev_t *local, struct rcs __iomem *prcs,
unsigned int pkt_addr, int rx_len); unsigned int pkt_addr, int rx_len);
static void rx_data(struct net_device *dev, struct rcs *prcs, unsigned int pkt_addr, static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, unsigned int pkt_addr,
int rx_len); int rx_len);
static void associate(ray_dev_t *local); static void associate(ray_dev_t *local);
...@@ -540,7 +538,7 @@ static void ray_config(dev_link_t *link) ...@@ -540,7 +538,7 @@ static void ray_config(dev_link_t *link)
CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win)); CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win));
mem.CardOffset = 0x0000; mem.Page = 0; mem.CardOffset = 0x0000; mem.Page = 0;
CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem)); CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
local->sram = (UCHAR *)(ioremap(req.Base,req.Size)); local->sram = ioremap(req.Base,req.Size);
/*** Set up 16k window for shared memory (receive buffer) ***************/ /*** Set up 16k window for shared memory (receive buffer) ***************/
req.Attributes = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT; req.Attributes = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT;
...@@ -550,7 +548,7 @@ static void ray_config(dev_link_t *link) ...@@ -550,7 +548,7 @@ static void ray_config(dev_link_t *link)
CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &local->rmem_handle)); CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &local->rmem_handle));
mem.CardOffset = 0x8000; mem.Page = 0; mem.CardOffset = 0x8000; mem.Page = 0;
CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->rmem_handle, &mem)); CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->rmem_handle, &mem));
local->rmem = (UCHAR *)(ioremap(req.Base,req.Size)); local->rmem = ioremap(req.Base,req.Size);
/*** Set up window for attribute memory ***********************************/ /*** Set up window for attribute memory ***********************************/
req.Attributes = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_AM | WIN_ENABLE | WIN_USE_WAIT; req.Attributes = WIN_DATA_WIDTH_8 | WIN_MEMORY_TYPE_AM | WIN_ENABLE | WIN_USE_WAIT;
...@@ -560,7 +558,7 @@ static void ray_config(dev_link_t *link) ...@@ -560,7 +558,7 @@ static void ray_config(dev_link_t *link)
CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &local->amem_handle)); CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &local->amem_handle));
mem.CardOffset = 0x0000; mem.Page = 0; mem.CardOffset = 0x0000; mem.Page = 0;
CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->amem_handle, &mem)); CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->amem_handle, &mem));
local->amem = (UCHAR *)(ioremap(req.Base,req.Size)); local->amem = ioremap(req.Base,req.Size);
DEBUG(3,"ray_config sram=%p\n",local->sram); DEBUG(3,"ray_config sram=%p\n",local->sram);
DEBUG(3,"ray_config rmem=%p\n",local->rmem); DEBUG(3,"ray_config rmem=%p\n",local->rmem);
...@@ -593,12 +591,30 @@ static void ray_config(dev_link_t *link) ...@@ -593,12 +591,30 @@ static void ray_config(dev_link_t *link)
ray_release(link); ray_release(link);
} /* ray_config */ } /* ray_config */
static inline struct ccs __iomem *ccs_base(ray_dev_t *dev)
{
return dev->sram + CCS_BASE;
}
static inline struct rcs __iomem *rcs_base(ray_dev_t *dev)
{
/*
* This looks nonsensical, since there is a separate
* RCS_BASE. But the difference between a "struct rcs"
* and a "struct ccs" ends up being in the _index_ off
* the base, so the base pointer is the same for both
* ccs/rcs.
*/
return dev->sram + CCS_BASE;
}
/*===========================================================================*/ /*===========================================================================*/
static int ray_init(struct net_device *dev) static int ray_init(struct net_device *dev)
{ {
int i; int i;
UCHAR *p; UCHAR *p;
struct ccs *pccs; struct ccs __iomem *pccs;
ray_dev_t *local = (ray_dev_t *)dev->priv; ray_dev_t *local = (ray_dev_t *)dev->priv;
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
DEBUG(1, "ray_init(0x%p)\n", dev); DEBUG(1, "ray_init(0x%p)\n", dev);
...@@ -632,7 +648,7 @@ static int ray_init(struct net_device *dev) ...@@ -632,7 +648,7 @@ static int ray_init(struct net_device *dev)
local->tib_length = local->startup_res.tib_length; local->tib_length = local->startup_res.tib_length;
DEBUG(2,"ray_init tib_length = 0x%02x\n", local->tib_length); DEBUG(2,"ray_init tib_length = 0x%02x\n", local->tib_length);
/* Initialize CCS's to buffer free state */ /* Initialize CCS's to buffer free state */
pccs = (struct ccs *)(local->sram + CCS_BASE); pccs = ccs_base(local);
for (i=0; i<NUMBER_OF_CCS; i++) { for (i=0; i<NUMBER_OF_CCS; i++) {
writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status); writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
} }
...@@ -661,7 +677,7 @@ static int dl_startup_params(struct net_device *dev) ...@@ -661,7 +677,7 @@ static int dl_startup_params(struct net_device *dev)
{ {
int ccsindex; int ccsindex;
ray_dev_t *local = (ray_dev_t *)dev->priv; ray_dev_t *local = (ray_dev_t *)dev->priv;
struct ccs *pccs; struct ccs __iomem *pccs;
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
DEBUG(1,"dl_startup_params entered\n"); DEBUG(1,"dl_startup_params entered\n");
...@@ -682,7 +698,7 @@ static int dl_startup_params(struct net_device *dev) ...@@ -682,7 +698,7 @@ static int dl_startup_params(struct net_device *dev)
/* Fill in the CCS fields for the ECF */ /* Fill in the CCS fields for the ECF */
if ((ccsindex = get_free_ccs(local)) < 0) return -1; if ((ccsindex = get_free_ccs(local)) < 0) return -1;
local->dl_param_ccs = ccsindex; local->dl_param_ccs = ccsindex;
pccs = ((struct ccs *)(local->sram + CCS_BASE)) + ccsindex; pccs = ccs_base(local) + ccsindex;
writeb(CCS_DOWNLOAD_STARTUP_PARAMS, &pccs->cmd); writeb(CCS_DOWNLOAD_STARTUP_PARAMS, &pccs->cmd);
DEBUG(2,"dl_startup_params start ccsindex = %d\n", local->dl_param_ccs); DEBUG(2,"dl_startup_params start ccsindex = %d\n", local->dl_param_ccs);
/* Interrupt the firmware to process the command */ /* Interrupt the firmware to process the command */
...@@ -767,7 +783,7 @@ static void init_startup_params(ray_dev_t *local) ...@@ -767,7 +783,7 @@ static void init_startup_params(ray_dev_t *local)
static void verify_dl_startup(u_long data) static void verify_dl_startup(u_long data)
{ {
ray_dev_t *local = (ray_dev_t *)data; ray_dev_t *local = (ray_dev_t *)data;
struct ccs *pccs = ((struct ccs *)(local->sram + CCS_BASE)) + local->dl_param_ccs; struct ccs __iomem *pccs = ccs_base(local) + local->dl_param_ccs;
UCHAR status; UCHAR status;
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
...@@ -807,7 +823,7 @@ static void verify_dl_startup(u_long data) ...@@ -807,7 +823,7 @@ static void verify_dl_startup(u_long data)
static void start_net(u_long data) static void start_net(u_long data)
{ {
ray_dev_t *local = (ray_dev_t *)data; ray_dev_t *local = (ray_dev_t *)data;
struct ccs *pccs; struct ccs __iomem *pccs;
int ccsindex; int ccsindex;
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
if (!(link->state & DEV_PRESENT)) { if (!(link->state & DEV_PRESENT)) {
...@@ -816,7 +832,7 @@ static void start_net(u_long data) ...@@ -816,7 +832,7 @@ static void start_net(u_long data)
} }
/* Fill in the CCS fields for the ECF */ /* Fill in the CCS fields for the ECF */
if ((ccsindex = get_free_ccs(local)) < 0) return; if ((ccsindex = get_free_ccs(local)) < 0) return;
pccs = ((struct ccs *)(local->sram + CCS_BASE)) + ccsindex; pccs = ccs_base(local) + ccsindex;
writeb(CCS_START_NETWORK, &pccs->cmd); writeb(CCS_START_NETWORK, &pccs->cmd);
writeb(0, &pccs->var.start_network.update_param); writeb(0, &pccs->var.start_network.update_param);
/* Interrupt the firmware to process the command */ /* Interrupt the firmware to process the command */
...@@ -834,7 +850,7 @@ static void join_net(u_long data) ...@@ -834,7 +850,7 @@ static void join_net(u_long data)
{ {
ray_dev_t *local = (ray_dev_t *)data; ray_dev_t *local = (ray_dev_t *)data;
struct ccs *pccs; struct ccs __iomem *pccs;
int ccsindex; int ccsindex;
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
...@@ -844,7 +860,7 @@ static void join_net(u_long data) ...@@ -844,7 +860,7 @@ static void join_net(u_long data)
} }
/* Fill in the CCS fields for the ECF */ /* Fill in the CCS fields for the ECF */
if ((ccsindex = get_free_ccs(local)) < 0) return; if ((ccsindex = get_free_ccs(local)) < 0) return;
pccs = ((struct ccs *)(local->sram + CCS_BASE)) + ccsindex; pccs = ccs_base(local) + ccsindex;
writeb(CCS_JOIN_NETWORK, &pccs->cmd); writeb(CCS_JOIN_NETWORK, &pccs->cmd);
writeb(0, &pccs->var.join_network.update_param); writeb(0, &pccs->var.join_network.update_param);
writeb(0, &pccs->var.join_network.net_initiated); writeb(0, &pccs->var.join_network.net_initiated);
...@@ -1049,10 +1065,10 @@ static int ray_hw_xmit(unsigned char* data, int len, struct net_device* dev, ...@@ -1049,10 +1065,10 @@ static int ray_hw_xmit(unsigned char* data, int len, struct net_device* dev,
UCHAR msg_type) UCHAR msg_type)
{ {
ray_dev_t *local = (ray_dev_t *)dev->priv; ray_dev_t *local = (ray_dev_t *)dev->priv;
struct ccs *pccs; struct ccs __iomem *pccs;
int ccsindex; int ccsindex;
int offset; int offset;
struct tx_msg *ptx; /* Address of xmit buffer in PC space */ struct tx_msg __iomem *ptx; /* Address of xmit buffer in PC space */
short int addr; /* Address of xmit buffer in card space */ short int addr; /* Address of xmit buffer in card space */
DEBUG(3,"ray_hw_xmit(data=%p, len=%d, dev=%p)\n",data,len,dev); DEBUG(3,"ray_hw_xmit(data=%p, len=%d, dev=%p)\n",data,len,dev);
...@@ -1079,7 +1095,7 @@ static int ray_hw_xmit(unsigned char* data, int len, struct net_device* dev, ...@@ -1079,7 +1095,7 @@ static int ray_hw_xmit(unsigned char* data, int len, struct net_device* dev,
local->stats.tx_packets++; local->stats.tx_packets++;
} }
ptx = (struct tx_msg *)(local->sram + addr); ptx = local->sram + addr;
ray_build_header(local, ptx, msg_type, data); ray_build_header(local, ptx, msg_type, data);
if (translate) { if (translate) {
...@@ -1092,7 +1108,7 @@ static int ray_hw_xmit(unsigned char* data, int len, struct net_device* dev, ...@@ -1092,7 +1108,7 @@ static int ray_hw_xmit(unsigned char* data, int len, struct net_device* dev,
} }
/* fill in the CCS */ /* fill in the CCS */
pccs = ((struct ccs *)(local->sram + CCS_BASE)) + ccsindex; pccs = ccs_base(local) + ccsindex;
len += TX_HEADER_LENGTH + offset; len += TX_HEADER_LENGTH + offset;
writeb(CCS_TX_REQUEST, &pccs->cmd); writeb(CCS_TX_REQUEST, &pccs->cmd);
writeb(addr >> 8, &pccs->var.tx_request.tx_data_ptr[0]); writeb(addr >> 8, &pccs->var.tx_request.tx_data_ptr[0]);
...@@ -1119,21 +1135,21 @@ static int ray_hw_xmit(unsigned char* data, int len, struct net_device* dev, ...@@ -1119,21 +1135,21 @@ static int ray_hw_xmit(unsigned char* data, int len, struct net_device* dev,
return XMIT_OK; return XMIT_OK;
} /* end ray_hw_xmit */ } /* end ray_hw_xmit */
/*===========================================================================*/ /*===========================================================================*/
static int translate_frame(ray_dev_t *local, struct tx_msg *ptx, unsigned char *data, static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx, unsigned char *data,
int len) int len)
{ {
unsigned short int proto = ((struct ethhdr *)data)->h_proto; unsigned short int proto = ((struct ethhdr *)data)->h_proto;
if (ntohs(proto) >= 1536) { /* DIX II ethernet frame */ if (ntohs(proto) >= 1536) { /* DIX II ethernet frame */
DEBUG(3,"ray_cs translate_frame DIX II\n"); DEBUG(3,"ray_cs translate_frame DIX II\n");
/* Copy LLC header to card buffer */ /* Copy LLC header to card buffer */
memcpy_toio((UCHAR *)&ptx->var, eth2_llc, sizeof(eth2_llc)); memcpy_toio(&ptx->var, eth2_llc, sizeof(eth2_llc));
memcpy_toio( ((UCHAR *)&ptx->var) + sizeof(eth2_llc), (UCHAR *)&proto, 2); memcpy_toio( ((void __iomem *)&ptx->var) + sizeof(eth2_llc), (UCHAR *)&proto, 2);
if ((proto == 0xf380) || (proto == 0x3781)) { if ((proto == 0xf380) || (proto == 0x3781)) {
/* This is the selective translation table, only 2 entries */ /* This is the selective translation table, only 2 entries */
writeb(0xf8, (UCHAR *) &((struct snaphdr_t *)ptx->var)->org[3]); writeb(0xf8, &((struct snaphdr_t __iomem *)ptx->var)->org[3]);
} }
/* Copy body of ethernet packet without ethernet header */ /* Copy body of ethernet packet without ethernet header */
memcpy_toio((UCHAR *)&ptx->var + sizeof(struct snaphdr_t), \ memcpy_toio((void __iomem *)&ptx->var + sizeof(struct snaphdr_t), \
data + ETH_HLEN, len - ETH_HLEN); data + ETH_HLEN, len - ETH_HLEN);
return (int) sizeof(struct snaphdr_t) - ETH_HLEN; return (int) sizeof(struct snaphdr_t) - ETH_HLEN;
} }
...@@ -1141,16 +1157,16 @@ static int translate_frame(ray_dev_t *local, struct tx_msg *ptx, unsigned char * ...@@ -1141,16 +1157,16 @@ static int translate_frame(ray_dev_t *local, struct tx_msg *ptx, unsigned char *
DEBUG(3,"ray_cs translate_frame 802\n"); DEBUG(3,"ray_cs translate_frame 802\n");
if (proto == 0xffff) { /* evil netware IPX 802.3 without LLC */ if (proto == 0xffff) { /* evil netware IPX 802.3 without LLC */
DEBUG(3,"ray_cs translate_frame evil IPX\n"); DEBUG(3,"ray_cs translate_frame evil IPX\n");
memcpy_toio((UCHAR *)&ptx->var, data + ETH_HLEN, len - ETH_HLEN); memcpy_toio(&ptx->var, data + ETH_HLEN, len - ETH_HLEN);
return 0 - ETH_HLEN; return 0 - ETH_HLEN;
} }
memcpy_toio((UCHAR *)&ptx->var, data + ETH_HLEN, len - ETH_HLEN); memcpy_toio(&ptx->var, data + ETH_HLEN, len - ETH_HLEN);
return 0 - ETH_HLEN; return 0 - ETH_HLEN;
} }
/* TBD do other frame types */ /* TBD do other frame types */
} /* end translate_frame */ } /* end translate_frame */
/*===========================================================================*/ /*===========================================================================*/
static void ray_build_header(ray_dev_t *local, struct tx_msg *ptx, UCHAR msg_type, static void ray_build_header(ray_dev_t *local, struct tx_msg __iomem *ptx, UCHAR msg_type,
unsigned char *data) unsigned char *data)
{ {
writeb(PROTOCOL_VER | msg_type, &ptx->mac.frame_ctl_1); writeb(PROTOCOL_VER | msg_type, &ptx->mac.frame_ctl_1);
...@@ -1633,7 +1649,7 @@ static iw_stats * ray_get_wireless_stats(struct net_device * dev) ...@@ -1633,7 +1649,7 @@ static iw_stats * ray_get_wireless_stats(struct net_device * dev)
{ {
ray_dev_t * local = (ray_dev_t *) dev->priv; ray_dev_t * local = (ray_dev_t *) dev->priv;
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
struct status *p = (struct status *)(local->sram + STATUS_BASE); struct status __iomem *p = local->sram + STATUS_BASE;
if(local == (ray_dev_t *) NULL) if(local == (ray_dev_t *) NULL)
return (iw_stats *) NULL; return (iw_stats *) NULL;
...@@ -1755,7 +1771,7 @@ static int interrupt_ecf(ray_dev_t *local, int ccs) ...@@ -1755,7 +1771,7 @@ static int interrupt_ecf(ray_dev_t *local, int ccs)
static int get_free_tx_ccs(ray_dev_t *local) static int get_free_tx_ccs(ray_dev_t *local)
{ {
int i; int i;
struct ccs *pccs = (struct ccs *)(local->sram + CCS_BASE); struct ccs __iomem *pccs = ccs_base(local);
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
if (!(link->state & DEV_PRESENT)) { if (!(link->state & DEV_PRESENT)) {
...@@ -1786,7 +1802,7 @@ static int get_free_tx_ccs(ray_dev_t *local) ...@@ -1786,7 +1802,7 @@ static int get_free_tx_ccs(ray_dev_t *local)
static int get_free_ccs(ray_dev_t *local) static int get_free_ccs(ray_dev_t *local)
{ {
int i; int i;
struct ccs *pccs = (struct ccs *)(local->sram + CCS_BASE); struct ccs __iomem *pccs = ccs_base(local);
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
if (!(link->state & DEV_PRESENT)) { if (!(link->state & DEV_PRESENT)) {
...@@ -1863,7 +1879,7 @@ static struct net_device_stats *ray_get_stats(struct net_device *dev) ...@@ -1863,7 +1879,7 @@ static struct net_device_stats *ray_get_stats(struct net_device *dev)
{ {
ray_dev_t *local = (ray_dev_t *)dev->priv; ray_dev_t *local = (ray_dev_t *)dev->priv;
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
struct status *p = (struct status *)(local->sram + STATUS_BASE); struct status __iomem *p = local->sram + STATUS_BASE;
if (!(link->state & DEV_PRESENT)) { if (!(link->state & DEV_PRESENT)) {
DEBUG(2,"ray_cs net_device_stats - device not present\n"); DEBUG(2,"ray_cs net_device_stats - device not present\n");
return &local->stats; return &local->stats;
...@@ -1895,7 +1911,7 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value, i ...@@ -1895,7 +1911,7 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value, i
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
int ccsindex; int ccsindex;
int i; int i;
struct ccs *pccs; struct ccs __iomem *pccs;
if (!(link->state & DEV_PRESENT)) { if (!(link->state & DEV_PRESENT)) {
DEBUG(2,"ray_update_parm - device not present\n"); DEBUG(2,"ray_update_parm - device not present\n");
...@@ -1907,7 +1923,7 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value, i ...@@ -1907,7 +1923,7 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value, i
DEBUG(0,"ray_update_parm - No free ccs\n"); DEBUG(0,"ray_update_parm - No free ccs\n");
return; return;
} }
pccs = ((struct ccs *)(local->sram + CCS_BASE)) + ccsindex; pccs = ccs_base(local) + ccsindex;
writeb(CCS_UPDATE_PARAMS, &pccs->cmd); writeb(CCS_UPDATE_PARAMS, &pccs->cmd);
writeb(objid, &pccs->var.update_param.object_id); writeb(objid, &pccs->var.update_param.object_id);
writeb(1, &pccs->var.update_param.number_objects); writeb(1, &pccs->var.update_param.number_objects);
...@@ -1926,11 +1942,11 @@ static void ray_update_multi_list(struct net_device *dev, int all) ...@@ -1926,11 +1942,11 @@ static void ray_update_multi_list(struct net_device *dev, int all)
{ {
struct dev_mc_list *dmi, **dmip; struct dev_mc_list *dmi, **dmip;
int ccsindex; int ccsindex;
struct ccs *pccs; struct ccs __iomem *pccs;
int i = 0; int i = 0;
ray_dev_t *local = (ray_dev_t *)dev->priv; ray_dev_t *local = (ray_dev_t *)dev->priv;
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
UCHAR *p = local->sram + HOST_TO_ECF_BASE; void __iomem *p = local->sram + HOST_TO_ECF_BASE;
if (!(link->state & DEV_PRESENT)) { if (!(link->state & DEV_PRESENT)) {
DEBUG(2,"ray_update_multi_list - device not present\n"); DEBUG(2,"ray_update_multi_list - device not present\n");
...@@ -1943,7 +1959,7 @@ static void ray_update_multi_list(struct net_device *dev, int all) ...@@ -1943,7 +1959,7 @@ static void ray_update_multi_list(struct net_device *dev, int all)
DEBUG(1,"ray_update_multi - No free ccs\n"); DEBUG(1,"ray_update_multi - No free ccs\n");
return; return;
} }
pccs = ((struct ccs *)(local->sram + CCS_BASE)) + ccsindex; pccs = ccs_base(local) + ccsindex;
writeb(CCS_UPDATE_MULTICAST_LIST, &pccs->cmd); writeb(CCS_UPDATE_MULTICAST_LIST, &pccs->cmd);
if (all) { if (all) {
...@@ -2011,8 +2027,8 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -2011,8 +2027,8 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs)
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = (struct net_device *)dev_id;
dev_link_t *link; dev_link_t *link;
ray_dev_t *local; ray_dev_t *local;
struct ccs *pccs; struct ccs __iomem *pccs;
struct rcs *prcs; struct rcs __iomem *prcs;
UCHAR rcsindex; UCHAR rcsindex;
UCHAR tmp; UCHAR tmp;
UCHAR cmd; UCHAR cmd;
...@@ -2029,7 +2045,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -2029,7 +2045,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs)
DEBUG(2,"ray_cs interrupt from device not present or suspended.\n"); DEBUG(2,"ray_cs interrupt from device not present or suspended.\n");
return IRQ_NONE; return IRQ_NONE;
} }
rcsindex = readb(&((struct scb *)(local->sram))->rcs_index); rcsindex = readb(&((struct scb __iomem *)(local->sram))->rcs_index);
if (rcsindex >= (NUMBER_OF_CCS + NUMBER_OF_RCS)) if (rcsindex >= (NUMBER_OF_CCS + NUMBER_OF_RCS))
{ {
...@@ -2039,7 +2055,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -2039,7 +2055,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs)
} }
if (rcsindex < NUMBER_OF_CCS) /* If it's a returned CCS */ if (rcsindex < NUMBER_OF_CCS) /* If it's a returned CCS */
{ {
pccs = ((struct ccs *) (local->sram + CCS_BASE)) + rcsindex; pccs = ccs_base(local) + rcsindex;
cmd = readb(&pccs->cmd); cmd = readb(&pccs->cmd);
status = readb(&pccs->buffer_status); status = readb(&pccs->buffer_status);
switch (cmd) switch (cmd)
...@@ -2153,7 +2169,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -2153,7 +2169,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs)
} }
else /* It's an RCS */ else /* It's an RCS */
{ {
prcs = ((struct rcs *)(local->sram + CCS_BASE)) + rcsindex; prcs = rcs_base(local) + rcsindex;
switch (readb(&prcs->interrupt_id)) switch (readb(&prcs->interrupt_id))
{ {
...@@ -2194,11 +2210,11 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -2194,11 +2210,11 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id, struct pt_regs * regs)
return IRQ_HANDLED; return IRQ_HANDLED;
} /* ray_interrupt */ } /* ray_interrupt */
/*===========================================================================*/ /*===========================================================================*/
static void ray_rx(struct net_device *dev, ray_dev_t *local, struct rcs *prcs) static void ray_rx(struct net_device *dev, ray_dev_t *local, struct rcs __iomem *prcs)
{ {
int rx_len; int rx_len;
unsigned int pkt_addr; unsigned int pkt_addr;
UCHAR *pmsg; void __iomem *pmsg;
DEBUG(4,"ray_rx process rx packet\n"); DEBUG(4,"ray_rx process rx packet\n");
/* Calculate address of packet within Rx buffer */ /* Calculate address of packet within Rx buffer */
...@@ -2248,11 +2264,11 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local, struct rcs *prcs) ...@@ -2248,11 +2264,11 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local, struct rcs *prcs)
} /* end ray_rx */ } /* end ray_rx */
/*===========================================================================*/ /*===========================================================================*/
static void rx_data(struct net_device *dev, struct rcs *prcs, unsigned int pkt_addr, static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, unsigned int pkt_addr,
int rx_len) int rx_len)
{ {
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
struct rcs *prcslink = prcs; struct rcs __iomem *prcslink = prcs;
ray_dev_t *local = dev->priv; ray_dev_t *local = dev->priv;
UCHAR *rx_ptr; UCHAR *rx_ptr;
int total_len; int total_len;
...@@ -2294,7 +2310,7 @@ static void rx_data(struct net_device *dev, struct rcs *prcs, unsigned int pkt_a ...@@ -2294,7 +2310,7 @@ static void rx_data(struct net_device *dev, struct rcs *prcs, unsigned int pkt_a
+ readb(&prcslink->var.rx_packet.rx_data_length[1]); + readb(&prcslink->var.rx_packet.rx_data_length[1]);
if (readb(&prcslink->var.rx_packet.next_frag_rcs_index) == 0xFF if (readb(&prcslink->var.rx_packet.next_frag_rcs_index) == 0xFF
|| tmp < 0) break; || tmp < 0) break;
prcslink = ((struct rcs *)(local->sram + CCS_BASE)) prcslink = rcs_base(local)
+ readb(&prcslink->link_field); + readb(&prcslink->link_field);
} while (1); } while (1);
...@@ -2355,7 +2371,7 @@ static void rx_data(struct net_device *dev, struct rcs *prcs, unsigned int pkt_a ...@@ -2355,7 +2371,7 @@ static void rx_data(struct net_device *dev, struct rcs *prcs, unsigned int pkt_a
prcslink = prcs; prcslink = prcs;
DEBUG(1,"ray_cs rx_data in fragment loop\n"); DEBUG(1,"ray_cs rx_data in fragment loop\n");
do { do {
prcslink = ((struct rcs *)(local->sram + CCS_BASE)) prcslink = rcs_base(local)
+ readb(&prcslink->var.rx_packet.next_frag_rcs_index); + readb(&prcslink->var.rx_packet.next_frag_rcs_index);
rx_len = (( readb(&prcslink->var.rx_packet.rx_data_length[0]) << 8) rx_len = (( readb(&prcslink->var.rx_packet.rx_data_length[0]) << 8)
+ readb(&prcslink->var.rx_packet.rx_data_length[1])) + readb(&prcslink->var.rx_packet.rx_data_length[1]))
...@@ -2529,9 +2545,9 @@ static int copy_from_rx_buff(ray_dev_t *local, UCHAR *dest, int pkt_addr, int le ...@@ -2529,9 +2545,9 @@ static int copy_from_rx_buff(ray_dev_t *local, UCHAR *dest, int pkt_addr, int le
return length; return length;
} }
/*===========================================================================*/ /*===========================================================================*/
static void release_frag_chain(ray_dev_t *local, struct rcs* prcs) static void release_frag_chain(ray_dev_t *local, struct rcs __iomem * prcs)
{ {
struct rcs *prcslink = prcs; struct rcs __iomem *prcslink = prcs;
int tmp = 17; int tmp = 17;
unsigned rcsindex = readb(&prcs->var.rx_packet.next_frag_rcs_index); unsigned rcsindex = readb(&prcs->var.rx_packet.next_frag_rcs_index);
...@@ -2541,7 +2557,7 @@ static void release_frag_chain(ray_dev_t *local, struct rcs* prcs) ...@@ -2541,7 +2557,7 @@ static void release_frag_chain(ray_dev_t *local, struct rcs* prcs)
DEBUG(1,"ray_cs interrupt bad rcsindex = 0x%x\n",rcsindex); DEBUG(1,"ray_cs interrupt bad rcsindex = 0x%x\n",rcsindex);
break; break;
} }
prcslink = ((struct rcs *)(local->sram + CCS_BASE)) + rcsindex; prcslink = rcs_base(local) + rcsindex;
rcsindex = readb(&prcslink->var.rx_packet.next_frag_rcs_index); rcsindex = readb(&prcslink->var.rx_packet.next_frag_rcs_index);
} }
writeb(CCS_BUFFER_FREE, &prcslink->buffer_status); writeb(CCS_BUFFER_FREE, &prcslink->buffer_status);
...@@ -2569,7 +2585,7 @@ static void authenticate(ray_dev_t *local) ...@@ -2569,7 +2585,7 @@ static void authenticate(ray_dev_t *local)
local->authentication_state = AWAITING_RESPONSE; local->authentication_state = AWAITING_RESPONSE;
} /* end authenticate */ } /* end authenticate */
/*===========================================================================*/ /*===========================================================================*/
static void rx_authenticate(ray_dev_t *local, struct rcs *prcs, static void rx_authenticate(ray_dev_t *local, struct rcs __iomem *prcs,
unsigned int pkt_addr, int rx_len) unsigned int pkt_addr, int rx_len)
{ {
UCHAR buff[256]; UCHAR buff[256];
...@@ -2614,7 +2630,7 @@ static void rx_authenticate(ray_dev_t *local, struct rcs *prcs, ...@@ -2614,7 +2630,7 @@ static void rx_authenticate(ray_dev_t *local, struct rcs *prcs,
/*===========================================================================*/ /*===========================================================================*/
static void associate(ray_dev_t *local) static void associate(ray_dev_t *local)
{ {
struct ccs *pccs; struct ccs __iomem *pccs;
dev_link_t *link = local->finder; dev_link_t *link = local->finder;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
int ccsindex; int ccsindex;
...@@ -2630,7 +2646,7 @@ static void associate(ray_dev_t *local) ...@@ -2630,7 +2646,7 @@ static void associate(ray_dev_t *local)
return; return;
} }
DEBUG(1,"ray_cs Starting association with access point\n"); DEBUG(1,"ray_cs Starting association with access point\n");
pccs = ((struct ccs *)(local->sram + CCS_BASE)) + ccsindex; pccs = ccs_base(local) + ccsindex;
/* fill in the CCS */ /* fill in the CCS */
writeb(CCS_START_ASSOCIATION, &pccs->cmd); writeb(CCS_START_ASSOCIATION, &pccs->cmd);
/* Interrupt the firmware to process the command */ /* Interrupt the firmware to process the command */
...@@ -2650,7 +2666,7 @@ static void associate(ray_dev_t *local) ...@@ -2650,7 +2666,7 @@ static void associate(ray_dev_t *local)
} /* end associate */ } /* end associate */
/*===========================================================================*/ /*===========================================================================*/
static void rx_deauthenticate(ray_dev_t *local, struct rcs *prcs, static void rx_deauthenticate(ray_dev_t *local, struct rcs __iomem *prcs,
unsigned int pkt_addr, int rx_len) unsigned int pkt_addr, int rx_len)
{ {
/* UCHAR buff[256]; /* UCHAR buff[256];
...@@ -2798,8 +2814,8 @@ static int ray_cs_proc_read(char *buf, char **start, off_t offset, int len) ...@@ -2798,8 +2814,8 @@ static int ray_cs_proc_read(char *buf, char **start, off_t offset, int len)
static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type) static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)
{ {
int addr; int addr;
struct ccs *pccs; struct ccs __iomem *pccs;
struct tx_msg *ptx; struct tx_msg __iomem *ptx;
int ccsindex; int ccsindex;
/* If no tx buffers available, return */ /* If no tx buffers available, return */
...@@ -2809,7 +2825,7 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type) ...@@ -2809,7 +2825,7 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)
return -1; return -1;
} }
pccs = ((struct ccs *)(local->sram + CCS_BASE)) + ccsindex; pccs = ccs_base(local) + ccsindex;
/* Address in card space */ /* Address in card space */
addr = TX_BUF_BASE + (ccsindex << 11); addr = TX_BUF_BASE + (ccsindex << 11);
...@@ -2821,7 +2837,7 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type) ...@@ -2821,7 +2837,7 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)
writeb(TX_AUTHENTICATE_LENGTH_LSB,pccs->var.tx_request.tx_data_length + 1); writeb(TX_AUTHENTICATE_LENGTH_LSB,pccs->var.tx_request.tx_data_length + 1);
writeb(0, &pccs->var.tx_request.pow_sav_mode); writeb(0, &pccs->var.tx_request.pow_sav_mode);
ptx = (struct tx_msg *)(local->sram + addr); ptx = local->sram + addr;
/* fill in the mac header */ /* fill in the mac header */
writeb(PROTOCOL_VER | AUTHENTIC_TYPE, &ptx->mac.frame_ctl_1); writeb(PROTOCOL_VER | AUTHENTIC_TYPE, &ptx->mac.frame_ctl_1);
writeb(0, &ptx->mac.frame_ctl_2); writeb(0, &ptx->mac.frame_ctl_2);
...@@ -2931,15 +2947,6 @@ static void __exit exit_ray_cs(void) ...@@ -2931,15 +2947,6 @@ static void __exit exit_ray_cs(void)
{ {
DEBUG(0, "ray_cs: cleanup_module\n"); DEBUG(0, "ray_cs: cleanup_module\n");
#ifdef CONFIG_PROC_FS
remove_proc_entry("ray_cs", proc_root_driver);
#endif
pcmcia_unregister_driver(&ray_driver);
while (dev_list != NULL)
ray_detach(dev_list);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
remove_proc_entry("driver/ray_cs/ray_cs", NULL); remove_proc_entry("driver/ray_cs/ray_cs", NULL);
remove_proc_entry("driver/ray_cs/essid", NULL); remove_proc_entry("driver/ray_cs/essid", NULL);
...@@ -2947,6 +2954,10 @@ static void __exit exit_ray_cs(void) ...@@ -2947,6 +2954,10 @@ static void __exit exit_ray_cs(void)
remove_proc_entry("driver/ray_cs/translate", NULL); remove_proc_entry("driver/ray_cs/translate", NULL);
remove_proc_entry("driver/ray_cs", NULL); remove_proc_entry("driver/ray_cs", NULL);
#endif #endif
pcmcia_unregister_driver(&ray_driver);
while (dev_list != NULL)
ray_detach(dev_list);
} /* exit_ray_cs */ } /* exit_ray_cs */
module_init(init_ray_cs); module_init(init_ray_cs);
......
...@@ -28,9 +28,9 @@ typedef struct ray_dev_t { ...@@ -28,9 +28,9 @@ typedef struct ray_dev_t {
dev_node_t node; dev_node_t node;
window_handle_t amem_handle; /* handle to window for attribute memory */ window_handle_t amem_handle; /* handle to window for attribute memory */
window_handle_t rmem_handle; /* handle to window for rx buffer on card */ window_handle_t rmem_handle; /* handle to window for rx buffer on card */
UCHAR *sram; /* pointer to beginning of shared RAM */ void __iomem *sram; /* pointer to beginning of shared RAM */
UCHAR *amem; /* pointer to attribute mem window */ void __iomem *amem; /* pointer to attribute mem window */
UCHAR *rmem; /* pointer to receive buffer window */ void __iomem *rmem; /* pointer to receive buffer window */
dev_link_t *finder; /* pointer back to dev_link_t for card */ dev_link_t *finder; /* pointer back to dev_link_t for card */
struct timer_list timer; struct timer_list timer;
long tx_ccs_lock; long tx_ccs_lock;
......
...@@ -133,7 +133,7 @@ extern void __cpu_copy_user_page(void *to, const void *from, ...@@ -133,7 +133,7 @@ extern void __cpu_copy_user_page(void *to, const void *from,
} while (0) } while (0)
#define clear_page(page) memzero((void *)(page), PAGE_SIZE) #define clear_page(page) memzero((void *)(page), PAGE_SIZE)
extern void copy_page(void *to, void *from); extern void copy_page(void *to, const void *from);
#undef STRICT_MM_TYPECHECKS #undef STRICT_MM_TYPECHECKS
......
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