dev->mem_end = ei_status.rmem_end = (u_long)info->base + req.Size; 
dev->mem_end = dev->mem_start + req.Size; 
static int setup_shmem_window(dev_link_t *link, int start_pg,			      int stop_pg, int cm_offset){    struct net_device *dev = link->priv;    pcnet_dev_t *info = PRIV(dev);    win_req_t req;    memreq_t mem;    int i, window_size, offset, last_ret, last_fn;    window_size = (stop_pg - start_pg) << 8;    if (window_size > 32 * 1024)	window_size = 32 * 1024;    /* Make sure it's a power of two.  */    while ((window_size & (window_size - 1)) != 0)	window_size += window_size & ~(window_size - 1);    /* Allocate a memory window */    req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE;    req.Attributes |= WIN_USE_WAIT;    req.Base = 0; req.Size = window_size;    req.AccessSpeed = mem_speed;    CS_CHECK(RequestWindow, pcmcia_request_window(&link->handle, &req, &link->win));    mem.CardOffset = (start_pg << 8) + cm_offset;    offset = mem.CardOffset % window_size;    mem.CardOffset -= offset;    mem.Page = 0;    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));    /* Try scribbling on the buffer */    info->base = ioremap(req.Base, window_size);    for (i = 0; i < (TX_PAGES<<8); i += 2)	__raw_writew((i>>1), info->base+offset+i);    udelay(100);    for (i = 0; i < (TX_PAGES<<8); i += 2)	if (__raw_readw(info->base+offset+i) != (i>>1)) break;    pcnet_reset_8390(dev);    if (i != (TX_PAGES<<8)) {	iounmap(info->base);	pcmcia_release_window(link->win);	info->base = NULL; link->win = NULL;	goto failed;    }        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;    ei_status.rx_start_page = start_pg + TX_PAGES;    ei_status.stop_page = start_pg + ((req.Size - offset) >> 8);    /* set up block i/o functions */    ei_status.get_8390_hdr = &shmem_get_8390_hdr;    ei_status.block_input = &shmem_block_input;    ei_status.block_output = &shmem_block_output;    info->flags |= USE_SHMEM;    return 0;cs_failed:    cs_error(link->handle, last_fn, last_ret);failed:    return 1;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/99417769bae55d34348320d7a05615e8a891fd3d/pcnet_cs.c/clean/drivers/net/pcmcia/pcnet_cs.c