(*handle)->state |= CLIENT_WIN_REQ(w); 
(*p_dev)->state |= CLIENT_WIN_REQ(w); 
int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle_t *wh){	struct pcmcia_socket *s;	window_t *win;	u_long align;	int w;	s = (*handle)->socket;	if (!(s->state & SOCKET_PRESENT))		return CS_NO_CARD;	if (req->Attributes & (WIN_PAGED | WIN_SHARED))		return CS_BAD_ATTRIBUTE;	/* Window size defaults to smallest available */	if (req->Size == 0)		req->Size = s->map_size;	align = (((s->features & SS_CAP_MEM_ALIGN) ||		  (req->Attributes & WIN_STRICT_ALIGN)) ?		 req->Size : s->map_size);	if (req->Size & (s->map_size-1))		return CS_BAD_SIZE;	if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) ||	    (req->Base & (align-1)))		return CS_BAD_BASE;	if (req->Base)		align = 0;	/* Allocate system memory window */	for (w = 0; w < MAX_WIN; w++)		if (!(s->state & SOCKET_WIN_REQ(w))) break;	if (w == MAX_WIN)		return CS_OUT_OF_RESOURCE;	win = &s->win[w];	win->magic = WINDOW_MAGIC;	win->index = w;	win->handle = *handle;	win->sock = s;	if (!(s->features & SS_CAP_STATIC_MAP)) {		win->ctl.res = pcmcia_find_mem_region(req->Base, req->Size, align,						      (req->Attributes & WIN_MAP_BELOW_1MB), s);		if (!win->ctl.res)			return CS_IN_USE;	}	(*handle)->state |= CLIENT_WIN_REQ(w);	/* Configure the socket controller */	win->ctl.map = w+1;	win->ctl.flags = 0;	win->ctl.speed = req->AccessSpeed;	if (req->Attributes & WIN_MEMORY_TYPE)		win->ctl.flags |= MAP_ATTRIB;	if (req->Attributes & WIN_ENABLE)		win->ctl.flags |= MAP_ACTIVE;	if (req->Attributes & WIN_DATA_WIDTH_16)		win->ctl.flags |= MAP_16BIT;	if (req->Attributes & WIN_USE_WAIT)		win->ctl.flags |= MAP_USE_WAIT;	win->ctl.card_start = 0;	if (s->ops->set_mem_map(s, &win->ctl) != 0)		return CS_BAD_ARGS;	s->state |= SOCKET_WIN_REQ(w);	/* Return window handle */	if (s->features & SS_CAP_STATIC_MAP) {		req->Base = win->ctl.static_start;	} else {		req->Base = win->ctl.res->start;	}	*wh = win;	return CS_SUCCESS;} /* pcmcia_request_window */
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/2bc5a9bdc56fac6f7cbf95b89443e3809141c247/pcmcia_resource.c/buggy/drivers/pcmcia/pcmcia_resource.c