Loading drivers/pcmcia/pcmcia_ioctl.c +9 −9 Original line number Original line Diff line number Diff line Loading @@ -224,7 +224,7 @@ static int pcmcia_adjust_resource_info(adjust_t *adj) static int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *wh_out, static int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *wh_out, window_handle_t wh, win_req_t *req) window_handle_t wh, win_req_t *req) { { window_t *win; pccard_mem_map *win; window_handle_t w; window_handle_t w; wh--; wh--; Loading @@ -238,17 +238,17 @@ static int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *wh_out, if (w == MAX_WIN) if (w == MAX_WIN) return -EINVAL; return -EINVAL; win = &s->win[w]; win = &s->win[w]; req->Base = win->ctl.res->start; req->Base = win->res->start; req->Size = win->ctl.res->end - win->ctl.res->start + 1; req->Size = win->res->end - win->res->start + 1; req->AccessSpeed = win->ctl.speed; req->AccessSpeed = win->speed; req->Attributes = 0; req->Attributes = 0; if (win->ctl.flags & MAP_ATTRIB) if (win->flags & MAP_ATTRIB) req->Attributes |= WIN_MEMORY_TYPE_AM; req->Attributes |= WIN_MEMORY_TYPE_AM; if (win->ctl.flags & MAP_ACTIVE) if (win->flags & MAP_ACTIVE) req->Attributes |= WIN_ENABLE; req->Attributes |= WIN_ENABLE; if (win->ctl.flags & MAP_16BIT) if (win->flags & MAP_16BIT) req->Attributes |= WIN_DATA_WIDTH_16; req->Attributes |= WIN_DATA_WIDTH_16; if (win->ctl.flags & MAP_USE_WAIT) if (win->flags & MAP_USE_WAIT) req->Attributes |= WIN_USE_WAIT; req->Attributes |= WIN_USE_WAIT; *wh_out = w + 1; *wh_out = w + 1; Loading @@ -268,7 +268,7 @@ static int pcmcia_get_mem_page(struct pcmcia_socket *skt, window_handle_t wh, return -EINVAL; return -EINVAL; req->Page = 0; req->Page = 0; req->CardOffset = skt->win[wh].ctl.card_start; req->CardOffset = skt->win[wh].card_start; return 0; return 0; } /* pcmcia_get_mem_page */ } /* pcmcia_get_mem_page */ Loading drivers/pcmcia/pcmcia_resource.c +23 −23 Original line number Original line Diff line number Diff line Loading @@ -197,8 +197,8 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh, dev_dbg(&s->dev, "failure: requested page is zero\n"); dev_dbg(&s->dev, "failure: requested page is zero\n"); return -EINVAL; return -EINVAL; } } s->win[wh].ctl.card_start = req->CardOffset; s->win[wh].card_start = req->CardOffset; if (s->ops->set_mem_map(s, &s->win[wh].ctl) != 0) { if (s->ops->set_mem_map(s, &s->win[wh]) != 0) { dev_dbg(&s->dev, "failed to set_mem_map\n"); dev_dbg(&s->dev, "failed to set_mem_map\n"); return -EIO; return -EIO; } } Loading Loading @@ -398,7 +398,7 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t wh) int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t wh) { { struct pcmcia_socket *s = p_dev->socket; struct pcmcia_socket *s = p_dev->socket; window_t *win; pccard_mem_map *win; wh--; wh--; if (wh >= MAX_WIN) if (wh >= MAX_WIN) Loading @@ -412,15 +412,15 @@ int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t wh) } } /* Shut down memory window */ /* Shut down memory window */ win->ctl.flags &= ~MAP_ACTIVE; win->flags &= ~MAP_ACTIVE; s->ops->set_mem_map(s, &win->ctl); s->ops->set_mem_map(s, win); s->state &= ~SOCKET_WIN_REQ(wh); s->state &= ~SOCKET_WIN_REQ(wh); /* Release system memory */ /* Release system memory */ if (win->ctl.res) { if (win->res) { release_resource(win->ctl.res); release_resource(win->res); kfree(win->ctl.res); kfree(win->res); win->ctl.res = NULL; win->res = NULL; } } p_dev->_win &= ~CLIENT_WIN_REQ(wh); p_dev->_win &= ~CLIENT_WIN_REQ(wh); Loading Loading @@ -755,7 +755,7 @@ EXPORT_SYMBOL(pcmcia_request_irq); int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh) int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh) { { struct pcmcia_socket *s = (*p_dev)->socket; struct pcmcia_socket *s = (*p_dev)->socket; window_t *win; pccard_mem_map *win; u_long align; u_long align; int w; int w; Loading Loading @@ -797,9 +797,9 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h win = &s->win[w]; win = &s->win[w]; if (!(s->features & SS_CAP_STATIC_MAP)) { if (!(s->features & SS_CAP_STATIC_MAP)) { win->ctl.res = pcmcia_find_mem_region(req->Base, req->Size, align, win->res = pcmcia_find_mem_region(req->Base, req->Size, align, (req->Attributes & WIN_MAP_BELOW_1MB), s); (req->Attributes & WIN_MAP_BELOW_1MB), s); if (!win->ctl.res) { if (!win->res) { dev_dbg(&s->dev, "allocating mem region failed\n"); dev_dbg(&s->dev, "allocating mem region failed\n"); return -EINVAL; return -EINVAL; } } Loading @@ -807,19 +807,19 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h (*p_dev)->_win |= CLIENT_WIN_REQ(w); (*p_dev)->_win |= CLIENT_WIN_REQ(w); /* Configure the socket controller */ /* Configure the socket controller */ win->ctl.map = w+1; win->map = w+1; win->ctl.flags = 0; win->flags = 0; win->ctl.speed = req->AccessSpeed; win->speed = req->AccessSpeed; if (req->Attributes & WIN_MEMORY_TYPE) if (req->Attributes & WIN_MEMORY_TYPE) win->ctl.flags |= MAP_ATTRIB; win->flags |= MAP_ATTRIB; if (req->Attributes & WIN_ENABLE) if (req->Attributes & WIN_ENABLE) win->ctl.flags |= MAP_ACTIVE; win->flags |= MAP_ACTIVE; if (req->Attributes & WIN_DATA_WIDTH_16) if (req->Attributes & WIN_DATA_WIDTH_16) win->ctl.flags |= MAP_16BIT; win->flags |= MAP_16BIT; if (req->Attributes & WIN_USE_WAIT) if (req->Attributes & WIN_USE_WAIT) win->ctl.flags |= MAP_USE_WAIT; win->flags |= MAP_USE_WAIT; win->ctl.card_start = 0; win->card_start = 0; if (s->ops->set_mem_map(s, &win->ctl) != 0) { if (s->ops->set_mem_map(s, win) != 0) { dev_dbg(&s->dev, "failed to set memory mapping\n"); dev_dbg(&s->dev, "failed to set memory mapping\n"); return -EIO; return -EIO; } } Loading @@ -827,9 +827,9 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h /* Return window handle */ /* Return window handle */ if (s->features & SS_CAP_STATIC_MAP) { if (s->features & SS_CAP_STATIC_MAP) { req->Base = win->ctl.static_start; req->Base = win->static_start; } else { } else { req->Base = win->ctl.res->start; req->Base = win->res->start; } } *wh = w + 1; *wh = w + 1; Loading include/pcmcia/ss.h +1 −5 Original line number Original line Diff line number Diff line Loading @@ -107,10 +107,6 @@ typedef struct io_window_t { struct resource *res; struct resource *res; } io_window_t; } io_window_t; typedef struct window_t { pccard_mem_map ctl; } window_t; /* Maximum number of IO windows per socket */ /* Maximum number of IO windows per socket */ #define MAX_IO_WIN 2 #define MAX_IO_WIN 2 Loading Loading @@ -150,7 +146,7 @@ struct pcmcia_socket { u_int Config; u_int Config; } irq; } irq; io_window_t io[MAX_IO_WIN]; io_window_t io[MAX_IO_WIN]; window_t win[MAX_WIN]; pccard_mem_map win[MAX_WIN]; struct list_head cis_cache; struct list_head cis_cache; size_t fake_cis_len; size_t fake_cis_len; u8 *fake_cis; u8 *fake_cis; Loading Loading
drivers/pcmcia/pcmcia_ioctl.c +9 −9 Original line number Original line Diff line number Diff line Loading @@ -224,7 +224,7 @@ static int pcmcia_adjust_resource_info(adjust_t *adj) static int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *wh_out, static int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *wh_out, window_handle_t wh, win_req_t *req) window_handle_t wh, win_req_t *req) { { window_t *win; pccard_mem_map *win; window_handle_t w; window_handle_t w; wh--; wh--; Loading @@ -238,17 +238,17 @@ static int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *wh_out, if (w == MAX_WIN) if (w == MAX_WIN) return -EINVAL; return -EINVAL; win = &s->win[w]; win = &s->win[w]; req->Base = win->ctl.res->start; req->Base = win->res->start; req->Size = win->ctl.res->end - win->ctl.res->start + 1; req->Size = win->res->end - win->res->start + 1; req->AccessSpeed = win->ctl.speed; req->AccessSpeed = win->speed; req->Attributes = 0; req->Attributes = 0; if (win->ctl.flags & MAP_ATTRIB) if (win->flags & MAP_ATTRIB) req->Attributes |= WIN_MEMORY_TYPE_AM; req->Attributes |= WIN_MEMORY_TYPE_AM; if (win->ctl.flags & MAP_ACTIVE) if (win->flags & MAP_ACTIVE) req->Attributes |= WIN_ENABLE; req->Attributes |= WIN_ENABLE; if (win->ctl.flags & MAP_16BIT) if (win->flags & MAP_16BIT) req->Attributes |= WIN_DATA_WIDTH_16; req->Attributes |= WIN_DATA_WIDTH_16; if (win->ctl.flags & MAP_USE_WAIT) if (win->flags & MAP_USE_WAIT) req->Attributes |= WIN_USE_WAIT; req->Attributes |= WIN_USE_WAIT; *wh_out = w + 1; *wh_out = w + 1; Loading @@ -268,7 +268,7 @@ static int pcmcia_get_mem_page(struct pcmcia_socket *skt, window_handle_t wh, return -EINVAL; return -EINVAL; req->Page = 0; req->Page = 0; req->CardOffset = skt->win[wh].ctl.card_start; req->CardOffset = skt->win[wh].card_start; return 0; return 0; } /* pcmcia_get_mem_page */ } /* pcmcia_get_mem_page */ Loading
drivers/pcmcia/pcmcia_resource.c +23 −23 Original line number Original line Diff line number Diff line Loading @@ -197,8 +197,8 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh, dev_dbg(&s->dev, "failure: requested page is zero\n"); dev_dbg(&s->dev, "failure: requested page is zero\n"); return -EINVAL; return -EINVAL; } } s->win[wh].ctl.card_start = req->CardOffset; s->win[wh].card_start = req->CardOffset; if (s->ops->set_mem_map(s, &s->win[wh].ctl) != 0) { if (s->ops->set_mem_map(s, &s->win[wh]) != 0) { dev_dbg(&s->dev, "failed to set_mem_map\n"); dev_dbg(&s->dev, "failed to set_mem_map\n"); return -EIO; return -EIO; } } Loading Loading @@ -398,7 +398,7 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t wh) int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t wh) { { struct pcmcia_socket *s = p_dev->socket; struct pcmcia_socket *s = p_dev->socket; window_t *win; pccard_mem_map *win; wh--; wh--; if (wh >= MAX_WIN) if (wh >= MAX_WIN) Loading @@ -412,15 +412,15 @@ int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t wh) } } /* Shut down memory window */ /* Shut down memory window */ win->ctl.flags &= ~MAP_ACTIVE; win->flags &= ~MAP_ACTIVE; s->ops->set_mem_map(s, &win->ctl); s->ops->set_mem_map(s, win); s->state &= ~SOCKET_WIN_REQ(wh); s->state &= ~SOCKET_WIN_REQ(wh); /* Release system memory */ /* Release system memory */ if (win->ctl.res) { if (win->res) { release_resource(win->ctl.res); release_resource(win->res); kfree(win->ctl.res); kfree(win->res); win->ctl.res = NULL; win->res = NULL; } } p_dev->_win &= ~CLIENT_WIN_REQ(wh); p_dev->_win &= ~CLIENT_WIN_REQ(wh); Loading Loading @@ -755,7 +755,7 @@ EXPORT_SYMBOL(pcmcia_request_irq); int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh) int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh) { { struct pcmcia_socket *s = (*p_dev)->socket; struct pcmcia_socket *s = (*p_dev)->socket; window_t *win; pccard_mem_map *win; u_long align; u_long align; int w; int w; Loading Loading @@ -797,9 +797,9 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h win = &s->win[w]; win = &s->win[w]; if (!(s->features & SS_CAP_STATIC_MAP)) { if (!(s->features & SS_CAP_STATIC_MAP)) { win->ctl.res = pcmcia_find_mem_region(req->Base, req->Size, align, win->res = pcmcia_find_mem_region(req->Base, req->Size, align, (req->Attributes & WIN_MAP_BELOW_1MB), s); (req->Attributes & WIN_MAP_BELOW_1MB), s); if (!win->ctl.res) { if (!win->res) { dev_dbg(&s->dev, "allocating mem region failed\n"); dev_dbg(&s->dev, "allocating mem region failed\n"); return -EINVAL; return -EINVAL; } } Loading @@ -807,19 +807,19 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h (*p_dev)->_win |= CLIENT_WIN_REQ(w); (*p_dev)->_win |= CLIENT_WIN_REQ(w); /* Configure the socket controller */ /* Configure the socket controller */ win->ctl.map = w+1; win->map = w+1; win->ctl.flags = 0; win->flags = 0; win->ctl.speed = req->AccessSpeed; win->speed = req->AccessSpeed; if (req->Attributes & WIN_MEMORY_TYPE) if (req->Attributes & WIN_MEMORY_TYPE) win->ctl.flags |= MAP_ATTRIB; win->flags |= MAP_ATTRIB; if (req->Attributes & WIN_ENABLE) if (req->Attributes & WIN_ENABLE) win->ctl.flags |= MAP_ACTIVE; win->flags |= MAP_ACTIVE; if (req->Attributes & WIN_DATA_WIDTH_16) if (req->Attributes & WIN_DATA_WIDTH_16) win->ctl.flags |= MAP_16BIT; win->flags |= MAP_16BIT; if (req->Attributes & WIN_USE_WAIT) if (req->Attributes & WIN_USE_WAIT) win->ctl.flags |= MAP_USE_WAIT; win->flags |= MAP_USE_WAIT; win->ctl.card_start = 0; win->card_start = 0; if (s->ops->set_mem_map(s, &win->ctl) != 0) { if (s->ops->set_mem_map(s, win) != 0) { dev_dbg(&s->dev, "failed to set memory mapping\n"); dev_dbg(&s->dev, "failed to set memory mapping\n"); return -EIO; return -EIO; } } Loading @@ -827,9 +827,9 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h /* Return window handle */ /* Return window handle */ if (s->features & SS_CAP_STATIC_MAP) { if (s->features & SS_CAP_STATIC_MAP) { req->Base = win->ctl.static_start; req->Base = win->static_start; } else { } else { req->Base = win->ctl.res->start; req->Base = win->res->start; } } *wh = w + 1; *wh = w + 1; Loading
include/pcmcia/ss.h +1 −5 Original line number Original line Diff line number Diff line Loading @@ -107,10 +107,6 @@ typedef struct io_window_t { struct resource *res; struct resource *res; } io_window_t; } io_window_t; typedef struct window_t { pccard_mem_map ctl; } window_t; /* Maximum number of IO windows per socket */ /* Maximum number of IO windows per socket */ #define MAX_IO_WIN 2 #define MAX_IO_WIN 2 Loading Loading @@ -150,7 +146,7 @@ struct pcmcia_socket { u_int Config; u_int Config; } irq; } irq; io_window_t io[MAX_IO_WIN]; io_window_t io[MAX_IO_WIN]; window_t win[MAX_WIN]; pccard_mem_map win[MAX_WIN]; struct list_head cis_cache; struct list_head cis_cache; size_t fake_cis_len; size_t fake_cis_len; u8 *fake_cis; u8 *fake_cis; Loading