aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wavelan_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:21:06 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:21:06 -0500
commitfba395eee7d3f342ca739c20f5b3ee635d0420a0 (patch)
tree5a73f68d3514aa795b0d8c500e4d72170651d762 /drivers/net/wireless/wavelan_cs.c
parentfd238232cd0ff4840ae6946bb338502154096d88 (diff)
[PATCH] pcmcia: remove dev_link_t and client_handle_t indirection
dev_link_t * and client_handle_t both mean struct pcmcai_device * by now. Therefore, remove all such indirections. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/wireless/wavelan_cs.c')
-rw-r--r--drivers/net/wireless/wavelan_cs.c67
1 files changed, 31 insertions, 36 deletions
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index baa1011e70e0..352d4a50b799 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -1005,7 +1005,7 @@ static inline void
1005wv_82593_reconfig(struct net_device * dev) 1005wv_82593_reconfig(struct net_device * dev)
1006{ 1006{
1007 net_local * lp = netdev_priv(dev); 1007 net_local * lp = netdev_priv(dev);
1008 dev_link_t * link = lp->link; 1008 struct pcmcia_device * link = lp->link;
1009 unsigned long flags; 1009 unsigned long flags;
1010 1010
1011 /* Arm the flag, will be cleard in wv_82593_config() */ 1011 /* Arm the flag, will be cleard in wv_82593_config() */
@@ -3744,16 +3744,16 @@ wv_pcmcia_reset(struct net_device * dev)
3744{ 3744{
3745 int i; 3745 int i;
3746 conf_reg_t reg = { 0, CS_READ, CISREG_COR, 0 }; 3746 conf_reg_t reg = { 0, CS_READ, CISREG_COR, 0 };
3747 dev_link_t * link = ((net_local *)netdev_priv(dev))->link; 3747 struct pcmcia_device * link = ((net_local *)netdev_priv(dev))->link;
3748 3748
3749#ifdef DEBUG_CONFIG_TRACE 3749#ifdef DEBUG_CONFIG_TRACE
3750 printk(KERN_DEBUG "%s: ->wv_pcmcia_reset()\n", dev->name); 3750 printk(KERN_DEBUG "%s: ->wv_pcmcia_reset()\n", dev->name);
3751#endif 3751#endif
3752 3752
3753 i = pcmcia_access_configuration_register(link->handle, &reg); 3753 i = pcmcia_access_configuration_register(link, &reg);
3754 if(i != CS_SUCCESS) 3754 if(i != CS_SUCCESS)
3755 { 3755 {
3756 cs_error(link->handle, AccessConfigurationRegister, i); 3756 cs_error(link, AccessConfigurationRegister, i);
3757 return FALSE; 3757 return FALSE;
3758 } 3758 }
3759 3759
@@ -3764,19 +3764,19 @@ wv_pcmcia_reset(struct net_device * dev)
3764 3764
3765 reg.Action = CS_WRITE; 3765 reg.Action = CS_WRITE;
3766 reg.Value = reg.Value | COR_SW_RESET; 3766 reg.Value = reg.Value | COR_SW_RESET;
3767 i = pcmcia_access_configuration_register(link->handle, &reg); 3767 i = pcmcia_access_configuration_register(link, &reg);
3768 if(i != CS_SUCCESS) 3768 if(i != CS_SUCCESS)
3769 { 3769 {
3770 cs_error(link->handle, AccessConfigurationRegister, i); 3770 cs_error(link, AccessConfigurationRegister, i);
3771 return FALSE; 3771 return FALSE;
3772 } 3772 }
3773 3773
3774 reg.Action = CS_WRITE; 3774 reg.Action = CS_WRITE;
3775 reg.Value = COR_LEVEL_IRQ | COR_CONFIG; 3775 reg.Value = COR_LEVEL_IRQ | COR_CONFIG;
3776 i = pcmcia_access_configuration_register(link->handle, &reg); 3776 i = pcmcia_access_configuration_register(link, &reg);
3777 if(i != CS_SUCCESS) 3777 if(i != CS_SUCCESS)
3778 { 3778 {
3779 cs_error(link->handle, AccessConfigurationRegister, i); 3779 cs_error(link, AccessConfigurationRegister, i);
3780 return FALSE; 3780 return FALSE;
3781 } 3781 }
3782 3782
@@ -3940,9 +3940,8 @@ wv_hw_reset(struct net_device * dev)
3940 * (called by wavelan_event()) 3940 * (called by wavelan_event())
3941 */ 3941 */
3942static inline int 3942static inline int
3943wv_pcmcia_config(dev_link_t * link) 3943wv_pcmcia_config(struct pcmcia_device * link)
3944{ 3944{
3945 client_handle_t handle = link->handle;
3946 tuple_t tuple; 3945 tuple_t tuple;
3947 cisparse_t parse; 3946 cisparse_t parse;
3948 struct net_device * dev = (struct net_device *) link->priv; 3947 struct net_device * dev = (struct net_device *) link->priv;
@@ -3965,16 +3964,16 @@ wv_pcmcia_config(dev_link_t * link)
3965 { 3964 {
3966 tuple.Attributes = 0; 3965 tuple.Attributes = 0;
3967 tuple.DesiredTuple = CISTPL_CONFIG; 3966 tuple.DesiredTuple = CISTPL_CONFIG;
3968 i = pcmcia_get_first_tuple(handle, &tuple); 3967 i = pcmcia_get_first_tuple(link, &tuple);
3969 if(i != CS_SUCCESS) 3968 if(i != CS_SUCCESS)
3970 break; 3969 break;
3971 tuple.TupleData = (cisdata_t *)buf; 3970 tuple.TupleData = (cisdata_t *)buf;
3972 tuple.TupleDataMax = 64; 3971 tuple.TupleDataMax = 64;
3973 tuple.TupleOffset = 0; 3972 tuple.TupleOffset = 0;
3974 i = pcmcia_get_tuple_data(handle, &tuple); 3973 i = pcmcia_get_tuple_data(link, &tuple);
3975 if(i != CS_SUCCESS) 3974 if(i != CS_SUCCESS)
3976 break; 3975 break;
3977 i = pcmcia_parse_tuple(handle, &tuple, &parse); 3976 i = pcmcia_parse_tuple(link, &tuple, &parse);
3978 if(i != CS_SUCCESS) 3977 if(i != CS_SUCCESS)
3979 break; 3978 break;
3980 link->conf.ConfigBase = parse.config.base; 3979 link->conf.ConfigBase = parse.config.base;
@@ -3983,7 +3982,7 @@ wv_pcmcia_config(dev_link_t * link)
3983 while(0); 3982 while(0);
3984 if(i != CS_SUCCESS) 3983 if(i != CS_SUCCESS)
3985 { 3984 {
3986 cs_error(link->handle, ParseTuple, i); 3985 cs_error(link, ParseTuple, i);
3987 link->state &= ~DEV_CONFIG_PENDING; 3986 link->state &= ~DEV_CONFIG_PENDING;
3988 return FALSE; 3987 return FALSE;
3989 } 3988 }
@@ -3992,10 +3991,10 @@ wv_pcmcia_config(dev_link_t * link)
3992 link->state |= DEV_CONFIG; 3991 link->state |= DEV_CONFIG;
3993 do 3992 do
3994 { 3993 {
3995 i = pcmcia_request_io(link->handle, &link->io); 3994 i = pcmcia_request_io(link, &link->io);
3996 if(i != CS_SUCCESS) 3995 if(i != CS_SUCCESS)
3997 { 3996 {
3998 cs_error(link->handle, RequestIO, i); 3997 cs_error(link, RequestIO, i);
3999 break; 3998 break;
4000 } 3999 }
4001 4000
@@ -4003,10 +4002,10 @@ wv_pcmcia_config(dev_link_t * link)
4003 * Now allocate an interrupt line. Note that this does not 4002 * Now allocate an interrupt line. Note that this does not
4004 * actually assign a handler to the interrupt. 4003 * actually assign a handler to the interrupt.
4005 */ 4004 */
4006 i = pcmcia_request_irq(link->handle, &link->irq); 4005 i = pcmcia_request_irq(link, &link->irq);
4007 if(i != CS_SUCCESS) 4006 if(i != CS_SUCCESS)
4008 { 4007 {
4009 cs_error(link->handle, RequestIRQ, i); 4008 cs_error(link, RequestIRQ, i);
4010 break; 4009 break;
4011 } 4010 }
4012 4011
@@ -4015,15 +4014,15 @@ wv_pcmcia_config(dev_link_t * link)
4015 * the I/O windows and the interrupt mapping. 4014 * the I/O windows and the interrupt mapping.
4016 */ 4015 */
4017 link->conf.ConfigIndex = 1; 4016 link->conf.ConfigIndex = 1;
4018 i = pcmcia_request_configuration(link->handle, &link->conf); 4017 i = pcmcia_request_configuration(link, &link->conf);
4019 if(i != CS_SUCCESS) 4018 if(i != CS_SUCCESS)
4020 { 4019 {
4021 cs_error(link->handle, RequestConfiguration, i); 4020 cs_error(link, RequestConfiguration, i);
4022 break; 4021 break;
4023 } 4022 }
4024 4023
4025 /* 4024 /*
4026 * Allocate a small memory window. Note that the dev_link_t 4025 * Allocate a small memory window. Note that the struct pcmcia_device
4027 * structure provides space for one window handle -- if your 4026 * structure provides space for one window handle -- if your
4028 * device needs several windows, you'll need to keep track of 4027 * device needs several windows, you'll need to keep track of
4029 * the handles in your private data structure, link->priv. 4028 * the handles in your private data structure, link->priv.
@@ -4031,10 +4030,10 @@ wv_pcmcia_config(dev_link_t * link)
4031 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 4030 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
4032 req.Base = req.Size = 0; 4031 req.Base = req.Size = 0;
4033 req.AccessSpeed = mem_speed; 4032 req.AccessSpeed = mem_speed;
4034 i = pcmcia_request_window(&link->handle, &req, &link->win); 4033 i = pcmcia_request_window(&link, &req, &link->win);
4035 if(i != CS_SUCCESS) 4034 if(i != CS_SUCCESS)
4036 { 4035 {
4037 cs_error(link->handle, RequestWindow, i); 4036 cs_error(link, RequestWindow, i);
4038 break; 4037 break;
4039 } 4038 }
4040 4039
@@ -4046,7 +4045,7 @@ wv_pcmcia_config(dev_link_t * link)
4046 i = pcmcia_map_mem_page(link->win, &mem); 4045 i = pcmcia_map_mem_page(link->win, &mem);
4047 if(i != CS_SUCCESS) 4046 if(i != CS_SUCCESS)
4048 { 4047 {
4049 cs_error(link->handle, MapMemPage, i); 4048 cs_error(link, MapMemPage, i);
4050 break; 4049 break;
4051 } 4050 }
4052 4051
@@ -4060,7 +4059,7 @@ wv_pcmcia_config(dev_link_t * link)
4060 lp->mem, dev->irq, (u_int) dev->base_addr); 4059 lp->mem, dev->irq, (u_int) dev->base_addr);
4061#endif 4060#endif
4062 4061
4063 SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 4062 SET_NETDEV_DEV(dev, &handle_to_dev(link));
4064 i = register_netdev(dev); 4063 i = register_netdev(dev);
4065 if(i != 0) 4064 if(i != 0)
4066 { 4065 {
@@ -4096,7 +4095,7 @@ wv_pcmcia_config(dev_link_t * link)
4096 * still open, this will be postponed until it is closed. 4095 * still open, this will be postponed until it is closed.
4097 */ 4096 */
4098static void 4097static void
4099wv_pcmcia_release(dev_link_t *link) 4098wv_pcmcia_release(struct pcmcia_device *link)
4100{ 4099{
4101 struct net_device * dev = (struct net_device *) link->priv; 4100 struct net_device * dev = (struct net_device *) link->priv;
4102 net_local * lp = netdev_priv(dev); 4101 net_local * lp = netdev_priv(dev);
@@ -4106,7 +4105,7 @@ wv_pcmcia_release(dev_link_t *link)
4106#endif 4105#endif
4107 4106
4108 iounmap(lp->mem); 4107 iounmap(lp->mem);
4109 pcmcia_disable_device(link->handle); 4108 pcmcia_disable_device(link);
4110 4109
4111#ifdef DEBUG_CONFIG_TRACE 4110#ifdef DEBUG_CONFIG_TRACE
4112 printk(KERN_DEBUG "%s: <- wv_pcmcia_release()\n", dev->name); 4111 printk(KERN_DEBUG "%s: <- wv_pcmcia_release()\n", dev->name);
@@ -4473,7 +4472,7 @@ static int
4473wavelan_open(struct net_device * dev) 4472wavelan_open(struct net_device * dev)
4474{ 4473{
4475 net_local * lp = netdev_priv(dev); 4474 net_local * lp = netdev_priv(dev);
4476 dev_link_t * link = lp->link; 4475 struct pcmcia_device * link = lp->link;
4477 kio_addr_t base = dev->base_addr; 4476 kio_addr_t base = dev->base_addr;
4478 4477
4479#ifdef DEBUG_CALLBACK_TRACE 4478#ifdef DEBUG_CALLBACK_TRACE
@@ -4527,7 +4526,7 @@ wavelan_open(struct net_device * dev)
4527static int 4526static int
4528wavelan_close(struct net_device * dev) 4527wavelan_close(struct net_device * dev)
4529{ 4528{
4530 dev_link_t * link = ((net_local *)netdev_priv(dev))->link; 4529 struct pcmcia_device * link = ((net_local *)netdev_priv(dev))->link;
4531 kio_addr_t base = dev->base_addr; 4530 kio_addr_t base = dev->base_addr;
4532 4531
4533#ifdef DEBUG_CALLBACK_TRACE 4532#ifdef DEBUG_CALLBACK_TRACE
@@ -4673,10 +4672,8 @@ wavelan_attach(struct pcmcia_device *p_dev)
4673 * is released. 4672 * is released.
4674 */ 4673 */
4675static void 4674static void
4676wavelan_detach(struct pcmcia_device *p_dev) 4675wavelan_detach(struct pcmcia_device *link)
4677{ 4676{
4678 dev_link_t *link = dev_to_instance(p_dev);
4679
4680#ifdef DEBUG_CALLBACK_TRACE 4677#ifdef DEBUG_CALLBACK_TRACE
4681 printk(KERN_DEBUG "-> wavelan_detach(0x%p)\n", link); 4678 printk(KERN_DEBUG "-> wavelan_detach(0x%p)\n", link);
4682#endif 4679#endif
@@ -4713,9 +4710,8 @@ wavelan_detach(struct pcmcia_device *p_dev)
4713#endif 4710#endif
4714} 4711}
4715 4712
4716static int wavelan_suspend(struct pcmcia_device *p_dev) 4713static int wavelan_suspend(struct pcmcia_device *link)
4717{ 4714{
4718 dev_link_t *link = dev_to_instance(p_dev);
4719 struct net_device * dev = (struct net_device *) link->priv; 4715 struct net_device * dev = (struct net_device *) link->priv;
4720 4716
4721 /* NB: wavelan_close will be called, but too late, so we are 4717 /* NB: wavelan_close will be called, but too late, so we are
@@ -4736,9 +4732,8 @@ static int wavelan_suspend(struct pcmcia_device *p_dev)
4736 return 0; 4732 return 0;
4737} 4733}
4738 4734
4739static int wavelan_resume(struct pcmcia_device *p_dev) 4735static int wavelan_resume(struct pcmcia_device *link)
4740{ 4736{
4741 dev_link_t *link = dev_to_instance(p_dev);
4742 struct net_device * dev = (struct net_device *) link->priv; 4737 struct net_device * dev = (struct net_device *) link->priv;
4743 4738
4744 link->state &= ~DEV_SUSPEND; 4739 link->state &= ~DEV_SUSPEND;