pcmcia: use pcmica_{read,write}_config_byte
Subsystems (19)
Dominik Brodowski
maintainerPATCH 1/11 pcmcia: use pcmica_{read,write}_config_byte
In reply to a message not in the archiveUse pcmcia_read_config_byte and pcmcia_write_config_byte instead of pcmcia_access_configuration_register.
--- drivers/net/pcmcia/axnet_cs.c | 3 +- drivers/net/pcmcia/nmclan_cs.c | 21 ++----- drivers/net/pcmcia/xirc2ps_cs.c | 16 ++--- drivers/net/wireless/hostap/hostap_cs.c | 91 ++++++++-------------------- drivers/net/wireless/orinoco/spectrum_cs.c | 32 +++------- drivers/pcmcia/cistpl.c | 7 +- drivers/pcmcia/cs_internal.h | 4 +- drivers/pcmcia/pcmcia_resource.c | 72 +++++++++++++--------- drivers/serial/serial_cs.c | 8 +-- drivers/ssb/pcmcia.c | 14 +---- include/pcmcia/cs.h | 12 ---- include/pcmcia/ds.h | 4 +- 12 files changed, 105 insertions(+), 179 deletions(-)
drivers/net/pcmcia/axnet_cs.c +1 -2
@@ -378,8 +378,7 @@ static int axnet_config(struct pcmcia_device *link)/* Maybe PHY is in power down mode. (PPD_SET = 1) Bit 2 of CCSR is active low. */ if (i ==32 ) { -conf_reg_t reg = {0 ,CS_WRITE ,CISREG_CCSR ,0x04 }; -pcmcia_access_configuration_register (link, ®); +pcmcia_write_config_byte (link,CISREG_CCSR ,0x04 );for (i =0 ; i <32 ; i++) { j =mdio_read (dev->base_addr +AXNET_MII_EEP , i,1 ); j2 =mdio_read (dev->base_addr +AXNET_MII_EEP , i,2 );
drivers/net/pcmcia/nmclan_cs.c +6 -15
@@ -757,29 +757,20 @@ static void nmclan_reset(struct net_device *dev)#if RESET_XILINX struct pcmcia_device *link = &lp->link; -conf_reg_t reg; -u_long OrigCorValue; +u8 OrigCorValue;/* Save original COR value */ - reg.Function =0 ; - reg.Action =CS_READ ; - reg.Offset =CISREG_COR ; - reg.Value =0 ; -pcmcia_access_configuration_register (link, ®); - OrigCorValue = reg.Value; +pcmcia_read_config_byte (link,CISREG_COR , &OrigCorValue);/* Reset Xilinx */ - reg.Action =CS_WRITE ; - reg.Offset =CISREG_COR ; -dev_dbg (&link->dev,"nmclan_reset: OrigCorValue=0x%lX, resetting...\n" , +dev_dbg (&link->dev,"nmclan_reset: OrigCorValue=0x%x, resetting...\n" , OrigCorValue); - reg.Value =COR_SOFT_RESET ; -pcmcia_access_configuration_register (link, ®); +pcmcia_write_config_byte (link,CISREG_COR ,COR_SOFT_RESET );/* Need to wait for 20 ms for PCMCIA to finish reset. */ /* Restore original COR configuration index */ - reg.Value =COR_LEVEL_REQ | (OrigCorValue &COR_CONFIG_MASK ); -pcmcia_access_configuration_register (link, ®); +pcmcia_write_config_byte (link,CISREG_COR , + (COR_LEVEL_REQ | (OrigCorValue &COR_CONFIG_MASK )));/* Xilinx is now completely reset along with the MACE chip. */ lp->tx_free_frames=AM2150_MAX_TX_FRAMES ;
drivers/net/pcmcia/xirc2ps_cs.c +7 -9
@@ -869,7 +869,6 @@ xirc2ps_config(struct pcmcia_device * link) goto config_error;if (local->dingo) { -conf_reg_t reg;win_req_t req;memreq_t mem;
@@ -878,15 +877,14 @@ xirc2ps_config(struct pcmcia_device * link)* the base address of the ethernet port (BasePort1) is written * to the BAR registers of the modem. */ - reg.Action =CS_WRITE ; - reg.Offset =CISREG_IOBASE_0 ; - reg.Value = link->io.BasePort2 &0xff ; -if ((err =pcmcia_access_configuration_register (link, ®))) + err =pcmcia_write_config_byte (link,CISREG_IOBASE_0 , + link->io.BasePort2 &0xff ); +if (err) goto config_error; - reg.Action =CS_WRITE ; - reg.Offset =CISREG_IOBASE_1 ; - reg.Value = (link->io.BasePort2 >>8 ) &0xff ; -if ((err =pcmcia_access_configuration_register (link, ®))) + + err =pcmcia_write_config_byte (link,CISREG_IOBASE_1 , + link->io.BasePort2 &0xff ); +if (err) goto config_error;/* There is no config entry for the Ethernet part which
drivers/net/wireless/hostap/hostap_cs.c +25 -66
183 lines not on this page · raw message
drivers/net/wireless/orinoco/spectrum_cs.c +10 -22
@@ -79,35 +79,27 @@ static int spectrum_reset(struct pcmcia_device *link, int idle) { int ret; -conf_reg_t reg; -u_int save_cor; +u8 save_cor; +u8 ccsr;/* Doing it if hardware is gone is guaranteed crash */ if (!pcmcia_dev_present (link))return -ENODEV ;/* Save original COR value */ - reg.Function =0 ; - reg.Action =CS_READ ; - reg.Offset =CISREG_COR ; - ret =pcmcia_access_configuration_register (link, ®); + ret =pcmcia_read_config_byte (link,CISREG_COR , &save_cor);if (ret) goto failed; - save_cor = reg.Value;/* Soft-Reset card */ - reg.Action =CS_WRITE ; - reg.Offset =CISREG_COR ; - reg.Value = (save_cor |COR_SOFT_RESET ); - ret =pcmcia_access_configuration_register (link, ®); + ret =pcmcia_write_config_byte (link,CISREG_COR , + (save_cor |COR_SOFT_RESET ));if (ret) goto failed;udelay (1000 );/* Read CCSR */ - reg.Action =CS_READ ; - reg.Offset =CISREG_CCSR ; - ret =pcmcia_access_configuration_register (link, ®); + ret =pcmcia_read_config_byte (link,CISREG_CCSR , &ccsr);if (ret) goto failed;
@@ -115,19 +107,15 @@ spectrum_reset(struct pcmcia_device *link, int idle)* Start or stop the firmware. Memory width bit should be * preserved from the value we've just read. */ - reg.Action =CS_WRITE ; - reg.Offset =CISREG_CCSR ; - reg.Value = (idle ?HCR_IDLE :HCR_RUN ) | (reg.Value &HCR_MEM16 ); - ret =pcmcia_access_configuration_register (link, ®); + ccsr = (idle ?HCR_IDLE :HCR_RUN ) | (ccsr &HCR_MEM16 ); + ret =pcmcia_write_config_byte (link,CISREG_CCSR , ccsr);if (ret) goto failed;udelay (1000 );/* Restore original COR configuration index */ - reg.Action =CS_WRITE ; - reg.Offset =CISREG_COR ; - reg.Value = (save_cor & ~COR_SOFT_RESET ); - ret =pcmcia_access_configuration_register (link, ®); + ret =pcmcia_write_config_byte (link,CISREG_COR , + (save_cor & ~COR_SOFT_RESET ));if (ret) goto failed;udelay (1000 );
drivers/pcmcia/cistpl.c +4 -3
@@ -209,7 +209,7 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,* Probably only useful for writing one-byte registers. Must be called * with ops_mutex held. */ -void pcmcia_write_cis_mem (struct pcmcia_socket *s,int attr,u_int addr, +int pcmcia_write_cis_mem (struct pcmcia_socket *s,int attr,u_int addr,u_int len,void *ptr) {void __iomem *sys, *end;
@@ -231,7 +231,7 @@ void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, ((cis_width) ? MAP_16BIT : 0));if (!sys) {dev_dbg (&s->dev,"could not map memory\n" ); -return ;/* FIXME: Error */ +return -EINVAL ; }writeb (flags, sys+CISREG_ICTRL0 );
@@ -256,7 +256,7 @@ void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, sys =set_cis_map (s, card_offset, flags);if (!sys) {dev_dbg (&s->dev,"could not map memory\n" ); -return ;/* FIXME: error */ +return -EINVAL ; } end = sys + s->map_size;
@@ -270,6 +270,7 @@ void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr, addr =0 ; } } +return 0 ; }
drivers/pcmcia/cs_internal.h +2 -2
@@ -158,8 +158,8 @@ extern struct bin_attribute pccard_cis_attr;int pcmcia_read_cis_mem (struct pcmcia_socket *s,int attr,u_int addr,u_int len,void *ptr); -void pcmcia_write_cis_mem (struct pcmcia_socket *s,int attr, -u_int addr,u_int len,void *ptr); +int pcmcia_write_cis_mem (struct pcmcia_socket *s,int attr, +u_int addr,u_int len,void *ptr);void release_cis_mem (struct pcmcia_socket *s);void destroy_cis_cache (struct pcmcia_socket *s); int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function,
drivers/pcmcia/pcmcia_resource.c +42 -28
93 lines not on this page · raw message
drivers/serial/serial_cs.c +3 -5
@@ -114,16 +114,14 @@ static void quirk_setup_brainboxes_0104(struct pcmcia_device *link, struct uart_static int quirk_post_ibm (struct pcmcia_device *link) { -conf_reg_t reg = {0 ,CS_READ ,0x800 ,0 }; +u8 val;int ret; - ret =pcmcia_access_configuration_register (link, ®); + ret =pcmcia_read_config_byte (link,0x800 , &val);if (ret) goto failed; - reg.Action =CS_WRITE ; - reg.Value = reg.Value |1 ; - ret =pcmcia_access_configuration_register (link, ®); + ret =pcmcia_write_config_byte (link,0x800 , val |1 );if (ret) goto failed;return 0 ;
drivers/ssb/pcmcia.c +2 -12
@@ -71,14 +71,9 @@/* Write to a PCMCIA configuration register. */ static int ssb_pcmcia_cfg_write (struct ssb_bus *bus,u8 offset,u8 value) { -conf_reg_t reg;int res; -memset (®,0 ,sizeof (reg)); - reg.Offset = offset; - reg.Action =CS_WRITE ; - reg.Value = value; - res =pcmcia_access_configuration_register (bus->host_pcmcia, ®); + res =pcmcia_write_config_byte (bus->host_pcmcia, offset, value);if (unlikely (res !=0 ))return -EBUSY ;
@@ -88,16 +83,11 @@ static int ssb_pcmcia_cfg_write(struct ssb_bus *bus, u8 offset, u8 value)/* Read from a PCMCIA configuration register. */ static int ssb_pcmcia_cfg_read (struct ssb_bus *bus,u8 offset,u8 *value) { -conf_reg_t reg;int res; -memset (®,0 ,sizeof (reg)); - reg.Offset = offset; - reg.Action =CS_READ ; - res =pcmcia_access_configuration_register (bus->host_pcmcia, ®); + res =pcmcia_read_config_byte (bus->host_pcmcia, offset, value);if (unlikely (res !=0 ))return -EBUSY ; - *value = reg.Value;return 0 ; }
include/pcmcia/cs.h +0 -12
@@ -19,18 +19,6 @@#include <linux/interrupt.h> #endif -/* For AccessConfigurationRegister */ -typedef struct conf_reg_t { -u_char Function; -u_int Action; -off_t Offset; -u_int Value; -}conf_reg_t ; - -/* Actions */ -#define CS_READ 1 -#define CS_WRITE 2 -/* for AdjustResourceInfo */ /* Action field */ #define REMOVE_MANAGED_RESOURCE 1
include/pcmcia/ds.h +2 -2
@@ -174,8 +174,8 @@ struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *p_dev);int pcmcia_reset_card (struct pcmcia_socket *skt);/* CIS config */ -int pcmcia_access_configuration_register (struct pcmcia_device *p_dev, -conf_reg_t *reg); +int pcmcia_read_config_byte (struct pcmcia_device *p_dev,off_t where,u8 *val); +int pcmcia_write_config_byte (struct pcmcia_device *p_dev,off_t where,u8 val);/* device configuration */ int pcmcia_request_io (struct pcmcia_device *p_dev,io_req_t *req);
Signature · 1 line
1.7.0.4
PATCH 4/11 pcmcia: do not use io_req_t after call to pcmcia_request_io()
In reply to a message not in the archiveAfter pcmcia_request_io(), do not make use of the values stored in io_req_t, but instead use those found in struct pcmcia_device->resource[].
--- drivers/ata/pata_pcmcia.c | 8 +++--- drivers/bluetooth/bluecard_cs.c | 18 ++++++++-------- drivers/bluetooth/bt3c_cs.c | 8 +++--- drivers/bluetooth/btuart_cs.c | 12 +++++----- drivers/bluetooth/dtl1_cs.c | 13 ++++++----- drivers/char/pcmcia/cm4000_cs.c | 12 +++++----- drivers/char/pcmcia/cm4040_cs.c | 16 +++++++------- drivers/char/pcmcia/ipwireless/main.c | 10 +++----- drivers/char/pcmcia/synclink_cs.c | 7 ++--- drivers/ide/ide-cs.c | 8 +++--- drivers/isdn/hardware/avm/avm_cs.c | 9 ++++--- drivers/isdn/hisax/avma1_cs.c | 8 ++++-- drivers/isdn/hisax/elsa_cs.c | 16 ++++++-------- drivers/isdn/hisax/sedlbauer_cs.c | 16 ++++++-------- drivers/isdn/hisax/teles_cs.c | 14 +++++------- drivers/net/pcmcia/3c574_cs.c | 2 +- drivers/net/pcmcia/3c589_cs.c | 2 +- drivers/net/pcmcia/axnet_cs.c | 4 +- drivers/net/pcmcia/com20020_cs.c | 2 +- drivers/net/pcmcia/fmvj18x_cs.c | 6 ++-- drivers/net/pcmcia/ibmtr_cs.c | 2 +- drivers/net/pcmcia/nmclan_cs.c | 2 +- drivers/net/pcmcia/pcnet_cs.c | 4 +- drivers/net/pcmcia/smc91c92_cs.c | 18 ++++++++-------- drivers/net/pcmcia/xirc2ps_cs.c | 12 +++++----- drivers/net/wireless/airo_cs.c | 12 ++++------ drivers/net/wireless/atmel_cs.c | 2 +- drivers/net/wireless/hostap/hostap_cs.c | 18 +++++++-------- drivers/net/wireless/libertas/if_cs.c | 7 ++--- drivers/net/wireless/orinoco/orinoco_cs.c | 5 ++- drivers/net/wireless/orinoco/spectrum_cs.c | 5 ++- drivers/net/wireless/wl3501_cs.c | 2 +- drivers/parport/parport_cs.c | 6 +++- drivers/scsi/pcmcia/aha152x_stub.c | 2 +- drivers/scsi/pcmcia/fdomain_stub.c | 4 +- drivers/scsi/pcmcia/nsp_cs.c | 25 ++++++++++----------- drivers/scsi/pcmcia/qlogic_stub.c | 18 ++++++++-------- drivers/scsi/pcmcia/sym53c500_cs.c | 16 +++++++------- drivers/serial/serial_cs.c | 22 +++++++++--------- drivers/staging/comedi/drivers/cb_das16_cs.c | 12 ++++------ drivers/staging/comedi/drivers/das08_cs.c | 12 ++++------ drivers/staging/comedi/drivers/ni_daq_700.c | 12 ++++------ drivers/staging/comedi/drivers/ni_daq_dio24.c | 12 ++++------ drivers/staging/comedi/drivers/ni_labpc_cs.c | 12 ++++------ drivers/staging/comedi/drivers/ni_mio_cs.c | 2 +- drivers/staging/comedi/drivers/quatech_daqp_cs.c | 12 ++++------ drivers/staging/wlags49_h2/wl_cs.c | 2 +- drivers/telephony/ixj_pcmcia.c | 3 +- drivers/usb/host/sl811_cs.c | 7 ++--- sound/pcmcia/pdaudiocf/pdaudiocf.c | 3 +- sound/pcmcia/vx/vxpocket.c | 3 +- 51 files changed, 224 insertions(+), 241 deletions(-)
drivers/ata/pata_pcmcia.c +4 -4
@@ -210,13 +210,13 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev, pdev->io.NumPorts2 = (stk->is_kme) ?2 :1 ;if (pcmcia_request_io (pdev, &pdev->io) !=0 )return -ENODEV ; - stk->ctl_base = pdev->io.BasePort2; + stk->ctl_base = pdev->resource[1 ]->start; }else if ((io->nwin ==1 ) && (io->win[0 ].len >=16 )) { pdev->io.NumPorts1 = io->win[0 ].len; pdev->io.NumPorts2 =0 ;if (pcmcia_request_io (pdev, &pdev->io) !=0 )return -ENODEV ; - stk->ctl_base = pdev->io.BasePort1 +0x0e ; + stk->ctl_base = pdev->resource[0 ]->start +0x0e ; }else return -ENODEV ;/* If we've got this far, we're done */
@@ -270,7 +270,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)if (pcmcia_loop_config (pdev, pcmcia_check_one_config, stk)) goto failed;/* No suitable config found */ } - io_base = pdev->io.BasePort1; + io_base = pdev->resource[0 ]->start; ctl_base = stk->ctl_base;if (!pdev->irq) goto failed;
@@ -293,7 +293,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)/* FIXME: Could be more ports at base + 0x10 but we only deal with one right now */ -if (pdev->io.NumPorts1 >=0x20 ) +if (resource_size (pdev->resource[0 ]) >=0x20 ) n_ports =2 ;if (pdev->manf_id ==0x0097 && pdev->card_id ==0x1620 )
drivers/bluetooth/bluecard_cs.c +9 -9
@@ -159,7 +159,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev);static void bluecard_activity_led_timeout (u_long arg) {bluecard_info_t *info = (bluecard_info_t *)arg; -unsigned int iobase = info->p_dev->io.BasePort1; +unsigned int iobase = info->p_dev->resource[0 ]->start;if (!test_bit (CARD_HAS_PCCARD_ID , &(info->hw_state)))return ;
@@ -176,7 +176,7 @@ static void bluecard_activity_led_timeout(u_long arg)static void bluecard_enable_activity_led (bluecard_info_t *info) { -unsigned int iobase = info->p_dev->io.BasePort1; +unsigned int iobase = info->p_dev->resource[0 ]->start;if (!test_bit (CARD_HAS_PCCARD_ID , &(info->hw_state)))return ;
@@ -232,7 +232,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info) } do { - register unsigned int iobase = info->p_dev->io.BasePort1; + register unsigned int iobase = info->p_dev->resource[0]->start; register unsigned int offset; register unsigned char command; register unsigned long ready_bit;
@@ -379,7 +379,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)return ; } - iobase = info->p_dev->io.BasePort1; + iobase = info->p_dev->resource[0 ]->start;if (test_bit (XMIT_SENDING_READY , &(info->tx_state)))bluecard_enable_activity_led (info);
@@ -508,7 +508,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)if (!test_bit (CARD_READY , &(info->hw_state)))return IRQ_HANDLED ; - iobase = info->p_dev->io.BasePort1; + iobase = info->p_dev->resource[0 ]->start;spin_lock (&(info->lock));
@@ -622,7 +622,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev)static int bluecard_hci_open (struct hci_dev *hdev) {bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data); -unsigned int iobase = info->p_dev->io.BasePort1; +unsigned int iobase = info->p_dev->resource[0 ]->start;if (test_bit (CARD_HAS_PCCARD_ID , &(info->hw_state)))bluecard_hci_set_baud_rate (hdev,DEFAULT_BAUD_RATE );
@@ -642,7 +642,7 @@ static int bluecard_hci_open(struct hci_dev *hdev)static int bluecard_hci_close (struct hci_dev *hdev) {bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data); -unsigned int iobase = info->p_dev->io.BasePort1; +unsigned int iobase = info->p_dev->resource[0 ]->start;if (!test_and_clear_bit (HCI_RUNNING , &(hdev->flags)))return 0 ;
@@ -709,7 +709,7 @@ static int bluecard_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned lstatic int bluecard_open (bluecard_info_t *info) { -unsigned int iobase = info->p_dev->io.BasePort1; +unsigned int iobase = info->p_dev->resource[0 ]->start;struct hci_dev *hdev;unsigned char id;
@@ -828,7 +828,7 @@ static int bluecard_open(bluecard_info_t *info)static int bluecard_close (bluecard_info_t *info) { -unsigned int iobase = info->p_dev->io.BasePort1; +unsigned int iobase = info->p_dev->resource[0 ]->start;struct hci_dev *hdev = info->hdev;if (!hdev)
drivers/bluetooth/bt3c_cs.c +4 -4
@@ -188,7 +188,7 @@ static void bt3c_write_wakeup(bt3c_info_t *info)return ; do { - register unsigned int iobase = info->p_dev->io.BasePort1; + register unsigned int iobase = info->p_dev->resource[0]->start; register struct sk_buff *skb; register int len;
@@ -226,7 +226,7 @@ static void bt3c_receive(bt3c_info_t *info)return ; } - iobase = info->p_dev->io.BasePort1; + iobase = info->p_dev->resource[0 ]->start; avail =bt3c_read (iobase,0x7006 );//printk("bt3c_cs: receiving %d bytes\n", avail);
@@ -347,7 +347,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)/* our irq handler is shared */ return IRQ_NONE ; - iobase = info->p_dev->io.BasePort1; + iobase = info->p_dev->resource[0 ]->start;spin_lock (&(info->lock));
@@ -480,7 +480,7 @@ static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware,unsigned int iobase, size, addr, fcs, tmp;int i, err =0 ; - iobase = info->p_dev->io.BasePort1; + iobase = info->p_dev->resource[0 ]->start;/* Reset */ bt3c_io_write (iobase,0x8040 ,0x0404 );
drivers/bluetooth/btuart_cs.c +6 -6
@@ -142,7 +142,7 @@ static void btuart_write_wakeup(btuart_info_t *info) } do { - register unsigned int iobase = info->p_dev->io.BasePort1; + register unsigned int iobase = info->p_dev->resource[0]->start; register struct sk_buff *skb; register int len;
@@ -183,7 +183,7 @@ static void btuart_receive(btuart_info_t *info)return ; } - iobase = info->p_dev->io.BasePort1; + iobase = info->p_dev->resource[0 ]->start; do { info->hdev->stat.byte_rx++;
@@ -297,7 +297,7 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst)/* our irq handler is shared */ return IRQ_NONE ; - iobase = info->p_dev->io.BasePort1; + iobase = info->p_dev->resource[0 ]->start;spin_lock (&(info->lock));
@@ -354,7 +354,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed)return ; } - iobase = info->p_dev->io.BasePort1; + iobase = info->p_dev->resource[0 ]->start;spin_lock_irqsave (&(info->lock), flags);
@@ -478,7 +478,7 @@ static int btuart_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned lonstatic int btuart_open (btuart_info_t *info) {unsigned long flags; -unsigned int iobase = info->p_dev->io.BasePort1; +unsigned int iobase = info->p_dev->resource[0 ]->start;struct hci_dev *hdev;spin_lock_init (&(info->lock));
@@ -548,7 +548,7 @@ static int btuart_open(btuart_info_t *info)static int btuart_close (btuart_info_t *info) {unsigned long flags; -unsigned int iobase = info->p_dev->io.BasePort1; +unsigned int iobase = info->p_dev->resource[0 ]->start;struct hci_dev *hdev = info->hdev;if (!hdev)
drivers/bluetooth/dtl1_cs.c +7 -6
@@ -149,7 +149,7 @@ static void dtl1_write_wakeup(dtl1_info_t *info) } do { - register unsigned int iobase = info->p_dev->io.BasePort1; + register unsigned int iobase = info->p_dev->resource[0]->start; register struct sk_buff *skb; register int len;
@@ -214,7 +214,7 @@ static void dtl1_receive(dtl1_info_t *info)return ; } - iobase = info->p_dev->io.BasePort1; + iobase = info->p_dev->resource[0 ]->start; do { info->hdev->stat.byte_rx++;
@@ -301,7 +301,7 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst)/* our irq handler is shared */ return IRQ_NONE ; - iobase = info->p_dev->io.BasePort1; + iobase = info->p_dev->resource[0 ]->start;spin_lock (&(info->lock));
@@ -461,7 +461,7 @@ static int dtl1_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned longstatic int dtl1_open (dtl1_info_t *info) {unsigned long flags; -unsigned int iobase = info->p_dev->io.BasePort1; +unsigned int iobase = info->p_dev->resource[0 ]->start;struct hci_dev *hdev;spin_lock_init (&(info->lock));
@@ -508,7 +508,8 @@ static int dtl1_open(dtl1_info_t *info)outb (UART_LCR_WLEN8 , iobase +UART_LCR );/* Reset DLAB */ outb ((UART_MCR_DTR |UART_MCR_RTS |UART_MCR_OUT2 ), iobase +UART_MCR ); - info->ri_latch =inb (info->p_dev->io.BasePort1 +UART_MSR ) &UART_MSR_RI ; + info->ri_latch =inb (info->p_dev->resource[0 ]->start +UART_MSR ) + &UART_MSR_RI ;/* Turn on interrupts */ outb (UART_IER_RLSI |UART_IER_RDI |UART_IER_THRI , iobase +UART_IER );
@@ -533,7 +534,7 @@ static int dtl1_open(dtl1_info_t *info)static int dtl1_close (dtl1_info_t *info) {unsigned long flags; -unsigned int iobase = info->p_dev->io.BasePort1; +unsigned int iobase = info->p_dev->resource[0 ]->start;struct hci_dev *hdev = info->hdev;if (!hdev)
drivers/char/pcmcia/cm4000_cs.c +6 -6
@@ -421,7 +421,7 @@ static struct card_fixup card_fixups[] = {static void set_cardparameter (struct cm4000_dev *dev) {int i; -unsigned int iobase = dev->p_dev->io.BasePort1; +unsigned int iobase = dev->p_dev->resource[0 ]->start;u_int8_t stopbits =0x02 ;/* ISO default */ DEBUGP (3 , dev,"-> set_cardparameter\n" );
@@ -454,7 +454,7 @@ static int set_protocol(struct cm4000_dev *dev, struct ptsreq *ptsreq)unsigned short num_bytes_read;unsigned char pts_reply[4 ];ssize_t rc; -unsigned int iobase = dev->p_dev->io.BasePort1; +unsigned int iobase = dev->p_dev->resource[0 ]->start; rc =0 ;
@@ -663,7 +663,7 @@ static void terminate_monitor(struct cm4000_dev *dev)static void monitor_card (unsigned long p) {struct cm4000_dev *dev = (struct cm4000_dev *) p; -unsigned int iobase = dev->p_dev->io.BasePort1; +unsigned int iobase = dev->p_dev->resource[0 ]->start;unsigned short s;struct ptsreq ptsreq;int i, atrc;
@@ -924,7 +924,7 @@ static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count, loff_t *ppos) {struct cm4000_dev *dev = filp->private_data; -unsigned int iobase = dev->p_dev->io.BasePort1; +unsigned int iobase = dev->p_dev->resource[0 ]->start;ssize_t rc;int i, j, k;
@@ -1047,7 +1047,7 @@ static ssize_t cmm_write(struct file *filp, const char __user *buf, size_t count, loff_t *ppos) { struct cm4000_dev *dev = filp->private_data; -unsigned int iobase = dev->p_dev->io.BasePort1; +unsigned int iobase = dev->p_dev->resource[0 ]->start;unsigned short s;unsigned char tmp;unsigned char infolen;
@@ -1400,7 +1400,7 @@ static void stop_monitor(struct cm4000_dev *dev)static long cmm_ioctl (struct file *filp,unsigned int cmd,unsigned long arg) {struct cm4000_dev *dev = filp->private_data; -unsigned int iobase = dev->p_dev->io.BasePort1; +unsigned int iobase = dev->p_dev->resource[0 ]->start;struct inode *inode = filp->f_path.dentry->d_inode;struct pcmcia_device *link;int size;
drivers/char/pcmcia/cm4040_cs.c +8 -8
@@ -109,7 +109,7 @@ static inline unsigned char xinb(unsigned short port)static void cm4040_do_poll (unsigned long dummy) {struct reader_dev *dev = (struct reader_dev *) dummy; -unsigned int obs =xinb (dev->p_dev->io.BasePort1 +unsigned int obs =xinb (dev->p_dev->resource[0 ]->start +REG_OFFSET_BUFFER_STATUS );if ((obs &BSR_BULK_IN_FULL )) {
@@ -140,7 +140,7 @@ static void cm4040_stop_poll(struct reader_dev *dev)static int wait_for_bulk_out_ready (struct reader_dev *dev) {int i, rc; -int iobase = dev->p_dev->io.BasePort1; +int iobase = dev->p_dev->resource[0 ]->start;for (i =0 ; i <POLL_LOOP_COUNT ; i++) { if ((xinb(iobase + REG_OFFSET_BUFFER_STATUS)
@@ -170,7 +170,7 @@ static int wait_for_bulk_out_ready(struct reader_dev *dev)/* Write to Sync Control Register */ static int write_sync_reg (unsigned char val,struct reader_dev *dev) { -int iobase = dev->p_dev->io.BasePort1; +int iobase = dev->p_dev->resource[0 ]->start;int rc; rc =wait_for_bulk_out_ready (dev);
@@ -188,7 +188,7 @@ static int write_sync_reg(unsigned char val, struct reader_dev *dev)static int wait_for_bulk_in_ready (struct reader_dev *dev) {int i, rc; -int iobase = dev->p_dev->io.BasePort1; +int iobase = dev->p_dev->resource[0 ]->start;for (i =0 ; i <POLL_LOOP_COUNT ; i++) { if ((xinb(iobase + REG_OFFSET_BUFFER_STATUS)
@@ -218,7 +218,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos) { struct reader_dev *dev = filp->private_data; -int iobase = dev->p_dev->io.BasePort1; +int iobase = dev->p_dev->resource[0 ]->start;size_t bytes_to_read;unsigned long i;size_t min_bytes_to_read;
@@ -320,7 +320,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf, size_t count, loff_t *ppos) { struct reader_dev *dev = filp->private_data; -int iobase = dev->p_dev->io.BasePort1; +int iobase = dev->p_dev->resource[0 ]->start;ssize_t rc;int i;unsigned int bytes_to_write;
@@ -567,8 +567,8 @@ static int reader_config(struct pcmcia_device *link, int devno) dev = link->priv; -DEBUGP (2 , dev,"device " DEVICE_NAME "%d at 0x%.4x-0x%.4x\n" , devno, - link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1); +DEBUGP (2 , dev,"device " DEVICE_NAME "%d at %pR\n" , devno, + link->resource[0 ]);DEBUGP (2 , dev,"<- reader_config (succ)\n" );return 0 ;
drivers/char/pcmcia/ipwireless/main.c +4 -6
@@ -100,7 +100,8 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,if (ret)return ret; - io_resource =request_region (p_dev->io.BasePort1, p_dev->io.NumPorts1, + io_resource =request_region (p_dev->resource[0 ]->start, +resource_size (p_dev->resource[0 ]),IPWIRELESS_PCCARD_NAME );if (cfg->mem.nwin ==0 )
@@ -197,7 +198,7 @@ static int config_ipwireless(struct ipw_dev *ipw)INIT_WORK (&ipw->work_reboot, signalled_reboot_work); -ipwireless_init_hardware_v1 (ipw->hardware, link->io.BasePort1, +ipwireless_init_hardware_v1 (ipw->hardware, link->resource[0 ]->start, ipw->attr_memory, ipw->common_memory, ipw->is_v2_card, signalled_reboot_callback, ipw);
@@ -209,10 +210,7 @@ static int config_ipwireless(struct ipw_dev *ipw) printk(KERN_INFO IPWIRELESS_PCCARD_NAME ": Card type %s\n", ipw->is_v2_card ? "V2/V3" : "V1"); printk(KERN_INFO IPWIRELESS_PCCARD_NAME - ": I/O ports 0x%04x-0x%04x, irq %d\n", - (unsigned int) link->io.BasePort1, - (unsigned int) (link->io.BasePort1 + - link->io.NumPorts1 - 1), + ": I/O ports %pR, irq %d\n", link->resource[0], (unsigned int) link->irq); if (ipw->attr_memory && ipw->common_memory) printk(KERN_INFO IPWIRELESS_PCCARD_NAME
drivers/char/pcmcia/synclink_cs.c +3 -4
@@ -609,16 +609,15 @@ static int mgslpc_config(struct pcmcia_device *link)if (ret) goto failed; - info->io_base = link->io.BasePort1; + info->io_base = link->resource[0 ]->start; info->irq_level = link->irq;dev_info (&link->dev,"index 0x%02x:" , link->conf.ConfigIndex);if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %d" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1+link->io.NumPorts1-1 ); +if (link->resource[0 ]) +printk (", io %pR" , link->resource[0 ]);printk ("\n" );return 0 ;
drivers/ide/ide-cs.c +4 -4
@@ -239,13 +239,13 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev, pdev->io.NumPorts2 = (stk->is_kme) ?2 :1 ;if (pcmcia_request_io (pdev, &pdev->io) !=0 )return -ENODEV ; - stk->ctl_base = pdev->io.BasePort2; + stk->ctl_base = pdev->resource[1 ]->start; }else if ((io->nwin ==1 ) && (io->win[0 ].len >=16 )) { pdev->io.NumPorts1 = io->win[0 ].len; pdev->io.NumPorts2 =0 ;if (pcmcia_request_io (pdev, &pdev->io) !=0 )return -ENODEV ; - stk->ctl_base = pdev->io.BasePort1 +0x0e ; + stk->ctl_base = pdev->resource[1 ]->start +0x0e ; }else return -ENODEV ;/* If we've got this far, we're done */
@@ -279,7 +279,7 @@ static int ide_config(struct pcmcia_device *link)if (pcmcia_loop_config (link, pcmcia_check_one_config, stk)) goto failed;/* No suitable config found */ } - io_base = link->io.BasePort1; + io_base = link->resource[0 ]->start; ctl_base = stk->ctl_base;if (!link->irq)
@@ -296,7 +296,7 @@ static int ide_config(struct pcmcia_device *link)outb (0x81 , ctl_base+1 ); host =idecs_register (io_base, ctl_base, link->irq, link); -if (host ==NULL && link->io.NumPorts1 ==0x20 ) { +if (host ==NULL &&resource_size (link->resource[0 ]) ==0x20 ) {outb (0x02 , ctl_base +0x10 ); host =idecs_register (io_base +0x10 , ctl_base +0x10 , link->irq, link);
drivers/isdn/hardware/avm/avm_cs.c +5 -4
@@ -191,9 +191,10 @@ static int avmcs_config(struct pcmcia_device *link)default :case AVM_CARDTYPE_B1 : addcard = b1pcmcia_addcard_b1;break ; } -if ((i = (*addcard)(link->io.BasePort1, link->irq)) <0 ) { -dev_err (&link->dev,"avm_cs: failed to add AVM-Controller at i/o %#x, irq %d\n" , - link->io.BasePort1, link->irq); +if ((i = (*addcard)(link->resource[0 ]->start, link->irq)) <0 ) { +dev_err (&link->dev, +"avm_cs: failed to add AVM-Controller at i/o %#x, irq %d\n" , + (unsigned int ) link->resource[0 ]->start, link->irq);avmcs_release (link);return -ENODEV ; }
@@ -211,7 +212,7 @@ static int avmcs_config(struct pcmcia_device *link)static void avmcs_release (struct pcmcia_device *link) { -b1pcmcia_delcard (link->io.BasePort1, link->irq); +b1pcmcia_delcard (link->resource[0 ]->start, link->irq);pcmcia_disable_device (link); }/* avmcs_release */
drivers/isdn/hisax/avma1_cs.c +5 -3
@@ -180,16 +180,18 @@ static int __devinit avma1cs_config(struct pcmcia_device *link) }printk (KERN_NOTICE "avma1_cs: checking at i/o %#x, irq %d\n" , - link->io.BasePort1, link->irq); + (unsigned int ) link->resource[0 ]->start, link->irq); icard.para[0 ] = link->irq; - icard.para[1 ] = link->io.BasePort1; + icard.para[1 ] = link->resource[0 ]->start; icard.protocol = isdnprot; icard.typ =ISDN_CTYPE_A1_PCMCIA ; i =hisax_init_pcmcia (link, &busy, &icard);if (i <0 ) { -printk (KERN_ERR "avma1_cs: failed to initialize AVM A1 PCMCIA %d at i/o %#x\n" , i, link->io.BasePort1); +printk (KERN_ERR "avma1_cs: failed to initialize AVM A1 " +"PCMCIA %d at i/o %#x\n" , i, + (unsigned int ) link->resource[0 ]->start);avma1cs_release (link);return -ENODEV ; }
drivers/isdn/hisax/elsa_cs.c +7 -9
@@ -214,23 +214,21 @@ static int __devinit elsa_cs_config(struct pcmcia_device *link) link->conf.ConfigIndex);if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %d" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1+link->io.NumPorts1-1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2+link->io.NumPorts2-1 ); +if (link->resource[0 ]) +printk (" & %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);printk ("\n" ); icard.para[0 ] = link->irq; - icard.para[1 ] = link->io.BasePort1; + icard.para[1 ] = link->resource[0 ]->start; icard.protocol = protocol; icard.typ =ISDN_CTYPE_ELSA_PCMCIA ; i =hisax_init_pcmcia (link, &(((local_info_t *)link->priv)->busy), &icard);if (i <0 ) { -printk (KERN_ERR "elsa_cs: failed to initialize Elsa PCMCIA %d at i/o %#x\n" , - i, link->io.BasePort1); +printk (KERN_ERR "elsa_cs: failed to initialize Elsa " +"PCMCIA %d with %pR\n" , i, link->resource[0 ]);elsa_cs_release (link); }else ((local_info_t *)link->priv)->cardnr = i;
drivers/isdn/hisax/sedlbauer_cs.c +7 -9
@@ -296,27 +296,25 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link)printk (", Vpp %d.%d" , link->conf.Vpp/10 , link->conf.Vpp%10 );if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %d" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1+link->io.NumPorts1-1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2+link->io.NumPorts2-1 ); +if (link->resource[0 ]) +printk (" & %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);if (link->win)printk (", mem 0x%06lx-0x%06lx" , req->Base, req->Base+req->Size-1 );printk ("\n" ); icard.para[0 ] = link->irq; - icard.para[1 ] = link->io.BasePort1; + icard.para[1 ] = link->resource[0 ]->start; icard.protocol = protocol; icard.typ =ISDN_CTYPE_SEDLBAUER_PCMCIA ; ret =hisax_init_pcmcia (link, &(((local_info_t *)link->priv)->stop), &icard);if (ret <0 ) { -printk (KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d at i/o %#x\n" , - ret, link->io.BasePort1); +printk (KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d with %pR\n" , + ret, link->resource[0 ]);sedlbauer_release (link);return -ENODEV ; }else
drivers/isdn/hisax/teles_cs.c +6 -8
@@ -194,23 +194,21 @@ static int __devinit teles_cs_config(struct pcmcia_device *link) link->conf.ConfigIndex);if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %d" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1+link->io.NumPorts1-1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2+link->io.NumPorts2-1 ); +if (link->resource[0 ]) +printk (" & %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);printk ("\n" ); icard.para[0 ] = link->irq; - icard.para[1 ] = link->io.BasePort1; + icard.para[1 ] = link->resource[0 ]->start; icard.protocol = protocol; icard.typ =ISDN_CTYPE_TELESPCMCIA ; i =hisax_init_pcmcia (link, &(((local_info_t *)link->priv)->busy), &icard);if (i <0 ) {printk (KERN_ERR "teles_cs: failed to initialize Teles PCMCIA %d at i/o %#x\n" , - i, link->io.BasePort1); + i, (unsigned int ) link->resource[0 ]->start);teles_cs_release (link);return -ENODEV ; }
drivers/net/pcmcia/3c574_cs.c +1 -1
@@ -356,7 +356,7 @@ static int tc574_config(struct pcmcia_device *link) goto failed; dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start; ioaddr = dev->base_addr;
drivers/net/pcmcia/3c589_cs.c +1 -1
@@ -298,7 +298,7 @@ static int tc589_config(struct pcmcia_device *link) goto failed; dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start; ioaddr = dev->base_addr;EL3WINDOW (0 );
drivers/net/pcmcia/axnet_cs.c +2 -2
@@ -332,7 +332,7 @@ static int axnet_config(struct pcmcia_device *link)if (!link->irq) goto failed; -if (link->io.NumPorts2 ==8 ) { +if (resource_size (link->resource[1 ]) ==8 ) { link->conf.Attributes |=CONF_ENABLE_SPKR ; link->conf.Status =CCSR_AUDIO_ENA ; }
@@ -342,7 +342,7 @@ static int axnet_config(struct pcmcia_device *link) goto failed; dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start;if (!get_prom (link)) {printk (KERN_NOTICE "axnet_cs: this is not an AX88190 card!\n" );
drivers/net/pcmcia/com20020_cs.c +1 -1
@@ -266,7 +266,7 @@ static int com20020_config(struct pcmcia_device *link) goto failed; } - ioaddr = dev->base_addr = link->io.BasePort1; + ioaddr = dev->base_addr = link->resource[0 ]->start;dev_dbg (&link->dev,"got ioaddr %Xh\n" , ioaddr); dev_dbg(&link->dev, "request IRQ %d\n",
drivers/net/pcmcia/fmvj18x_cs.c +3 -3
@@ -315,7 +315,7 @@ static int ungermann_try_io_port(struct pcmcia_device *link)if (ret ==0 ) {/* calculate ConfigIndex value */ link->conf.ConfigIndex = - ((link->io.BasePort1 &0x0f0 ) >>3 ) |0x22 ; + ((link->resource[0 ]->start &0x0f0 ) >>3 ) |0x22 ;return ret; } }
@@ -436,9 +436,9 @@ static int fmvj18x_config(struct pcmcia_device *link) goto failed; dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start; -if (link->io.BasePort2 !=0 ) { +if (resource_size (link->resource[1 ]) !=0 ) { ret =fmvj18x_setup_mfc (link);if (ret !=0 ) goto failed; }
drivers/net/pcmcia/ibmtr_cs.c +1 -1
@@ -231,7 +231,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)if (ret) goto failed; } - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start; ret =pcmcia_request_exclusive_irq (link, ibmtr_interrupt);if (ret)
drivers/net/pcmcia/nmclan_cs.c +1 -1
@@ -655,7 +655,7 @@ static int nmclan_config(struct pcmcia_device *link) goto failed; dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start; ioaddr = dev->base_addr;
drivers/net/pcmcia/pcnet_cs.c +2 -2
@@ -554,7 +554,7 @@ static int pcnet_config(struct pcmcia_device *link)if (!link->irq) goto failed; -if (link->io.NumPorts2 ==8 ) { +if (resource_size (link->resource[1 ]) ==8 ) { link->conf.Attributes |=CONF_ENABLE_SPKR ; link->conf.Status =CCSR_AUDIO_ENA ; }
@@ -566,7 +566,7 @@ static int pcnet_config(struct pcmcia_device *link)if (ret) goto failed; dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start;if (info->flags &HAS_MISC_REG ) {if ((if_port ==1 ) || (if_port ==2 )) dev->if_port = if_port;
drivers/net/pcmcia/smc91c92_cs.c +9 -9
@@ -457,7 +457,7 @@ static int mhz_mfc_config(struct pcmcia_device *link)if (pcmcia_loop_config (link, mhz_mfc_config_check,NULL ))return -ENODEV ; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start;/* Allocate a memory window, for accessing the ISR */ req.Attributes =WIN_DATA_WIDTH_8 |WIN_MEMORY_TYPE_AM |WIN_ENABLE ;
@@ -545,7 +545,7 @@ static void mot_config(struct pcmcia_device *link)struct net_device *dev = link->priv;struct smc_private *smc =netdev_priv (dev);unsigned int ioaddr = dev->base_addr; -unsigned int iouart = link->io.BasePort2; +unsigned int iouart = link->resource[1 ]->start;/* Set UART base address and force map with COR bit 1 */ writeb (iouart &0xff , smc->base +MOT_UART +CISREG_IOBASE_0 );
@@ -614,7 +614,7 @@ static int smc_config(struct pcmcia_device *link) link->io.NumPorts1 =16 ; i =pcmcia_loop_config (link, smc_configcheck,NULL );if (!i) - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start;return i; }
@@ -666,7 +666,7 @@ static int osi_config(struct pcmcia_device *link) link->io.NumPorts2 =0 ; i =pcmcia_request_io (link, &link->io); } - dev->base_addr = link->io.BasePort1 +0x10 ; + dev->base_addr = link->resource[0 ]->start +0x10 ;return i; }
@@ -683,7 +683,7 @@ static int osi_load_firmware(struct pcmcia_device *link)/* Download the Seven of Diamonds firmware */ for (i =0 ; i < fw->size; i++) { -outb (fw->data[i], link->io.BasePort1 +2 ); +outb (fw->data[i], link->resource[0 ]->start +2 );udelay (50 ); }release_firmware (fw);
@@ -725,12 +725,12 @@ static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid)return rc; }else if (manfid ==MANFID_OSITECH ) {/* Make sure both functions are powered up */ -set_bits (0x300 , link->io.BasePort1 +OSITECH_AUI_PWR ); +set_bits (0x300 , link->resource[0 ]->start +OSITECH_AUI_PWR );/* Now, turn on the interrupt for both card functions */ -set_bits (0x300 , link->io.BasePort1 +OSITECH_RESET_ISR ); +set_bits (0x300 , link->resource[0 ]->start +OSITECH_RESET_ISR );dev_dbg (&link->dev,"AUI/PWR: %4.4x RESET/ISR: %4.4x\n" , -inw (link->io.BasePort1 +OSITECH_AUI_PWR ), -inw (link->io.BasePort1 +OSITECH_RESET_ISR )); +inw (link->resource[0 ]->start +OSITECH_AUI_PWR ), +inw (link->resource[0 ]->start +OSITECH_RESET_ISR )); }return 0 ; }
drivers/net/pcmcia/xirc2ps_cs.c +6 -6
@@ -877,13 +877,13 @@ xirc2ps_config(struct pcmcia_device * link)* the base address of the ethernet port (BasePort1) is written * to the BAR registers of the modem. */ - err =pcmcia_write_config_byte (link,CISREG_IOBASE_0 , - link->io.BasePort2 &0xff ); + err =pcmcia_write_config_byte (link,CISREG_IOBASE_0 , (u8 ) + link->resource[1 ]->start &0xff );if (err) goto config_error; - err =pcmcia_write_config_byte (link,CISREG_IOBASE_1 , - link->io.BasePort2 &0xff ); + err =pcmcia_write_config_byte (link,CISREG_IOBASE_1 , (u8 ) + link->resource[1 ]->start &0xff );if (err) goto config_error;
@@ -907,7 +907,7 @@ xirc2ps_config(struct pcmcia_device * link)* part. */ writeb (0x47 , local->dingo_ccr +CISREG_COR ); - ioaddr = link->io.BasePort1; + ioaddr = link->resource[0 ]->start;writeb (ioaddr &0xff , local->dingo_ccr +CISREG_IOBASE_0 );writeb ((ioaddr >>8 )&0xff , local->dingo_ccr +CISREG_IOBASE_1 );
@@ -954,7 +954,7 @@ xirc2ps_config(struct pcmcia_device * link)/* we can now register the device with the net subsystem */ dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start;if (local->dingo)do_reset (dev,1 );/* a kludge to make the cem56 work */
drivers/net/wireless/airo_cs.c +5 -7
@@ -271,7 +271,7 @@ static int airo_config(struct pcmcia_device *link) goto failed; ((local_info_t *)link->priv)->eth_dev =init_airo_card (link->irq, - link->io.BasePort1,1 , &link->dev); + link->resource[0 ]->start,1 , &link->dev);if (!((local_info_t *)link->priv)->eth_dev) goto failed;
@@ -281,12 +281,10 @@ static int airo_config(struct pcmcia_device *link)if (link->conf.Vpp)printk (", Vpp %d.%d" , link->conf.Vpp/10 , link->conf.Vpp%10 );printk (", irq %d" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1+link->io.NumPorts1-1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2+link->io.NumPorts2-1 ); +if (link->resource[0 ]) +printk (" & %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);if (link->win)printk (", mem 0x%06lx-0x%06lx" , req->Base, req->Base+req->Size-1 );
drivers/net/wireless/atmel_cs.c +1 -1
@@ -253,7 +253,7 @@ static int atmel_config(struct pcmcia_device *link) ((local_info_t *)link->priv)->eth_dev = init_atmel_card(link->irq, - link->io.BasePort1, + link->resource[0]->start, did ? did->driver_info : ATMEL_FW_TYPE_NONE, &link->dev, card_present,
drivers/net/wireless/hostap/hostap_cs.c +8 -10
@@ -227,7 +227,7 @@ static void sandisk_set_iobase(local_info_t *local)struct hostap_cs_priv *hw_priv = local->hw_priv; res =pcmcia_write_config_byte (hw_priv->link,0x10 , - hw_priv->link->io.BasePort1 &0x00ff ); + hw_priv->link->resource[0 ]->start &0x00ff );if (res !=0 ) {printk (KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 0 -" " res=%d\n" , res);
@@ -235,7 +235,7 @@ static void sandisk_set_iobase(local_info_t *local)udelay (10 ); res =pcmcia_write_config_byte (hw_priv->link,0x12 , - hw_priv->link->io.BasePort1 &0x00ff ); + hw_priv->link->resource[0 ]->start &0x00ff );if (res !=0 ) {printk (KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 1 -" " res=%d\n" , res);
@@ -265,7 +265,7 @@ static int sandisk_enable_wireless(struct net_device *dev)local_info_t *local = iface->local;struct hostap_cs_priv *hw_priv = local->hw_priv; -if (hw_priv->link->io.NumPorts1 <0x42 ) { +if (resource_size (hw_priv->link->resource[0 ]) <0x42 ) {/* Not enough ports to be SanDisk multi-function card */ ret = -ENODEV ; goto done;
@@ -604,7 +604,7 @@ static int prism2_config(struct pcmcia_device *link) goto failed_unlock; dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start;spin_unlock_irqrestore (&local->irq_init_lock, flags);
@@ -616,12 +616,10 @@ static int prism2_config(struct pcmcia_device *link) link->conf.Vpp % 10);if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %d" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1+link->io.NumPorts1-1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2+link->io.NumPorts2-1 ); +if (link->resource[0 ]) +printk (" & %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);printk ("\n" ); local->shutdown =0 ;
drivers/net/wireless/libertas/if_cs.c +3 -4
@@ -853,7 +853,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev) goto out1;/* Initialize io access */ - card->iobase =ioport_map (p_dev->io.BasePort1, p_dev->io.NumPorts1); + card->iobase =ioport_map (p_dev->resource[0 ]->start, +resource_size (p_dev->resource[0 ]));if (!card->iobase) {lbs_pr_err ("error in ioport_map\n" ); ret = -EIO ;
@@ -872,9 +873,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) }/* Finally, report what we've done */ -lbs_deb_cs ("irq %d, io 0x%04x-0x%04x\n" , - p_dev->irq, p_dev->io.BasePort1, - p_dev->io.BasePort1 + p_dev->io.NumPorts1 -1 ); +lbs_deb_cs ("irq %d, io %pR" , p_dev->irq, p_dev->resource[0 ]);/* * Most of the libertas cards can do unaligned register access, but some
drivers/net/wireless/orinoco/orinoco_cs.c +3 -2
@@ -257,7 +257,8 @@ orinoco_cs_config(struct pcmcia_device *link)/* We initialize the hermes structure before completing PCMCIA * configuration just in case the interrupt handler gets * called. */ - mem =ioport_map (link->io.BasePort1, link->io.NumPorts1); + mem =ioport_map (link->resource[0 ]->start, +resource_size (link->resource[0 ]));if (!mem) goto failed;
@@ -279,7 +280,7 @@ orinoco_cs_config(struct pcmcia_device *link) }/* Register an interface with the stack */ -if (orinoco_if_add (priv, link->io.BasePort1, +if (orinoco_if_add (priv, link->resource[0 ]->start, link->irq,NULL ) !=0 ) { printk(KERN_ERR PFX "orinoco_if_add() failed\n"); goto failed;
drivers/net/wireless/orinoco/spectrum_cs.c +3 -2
@@ -319,7 +319,8 @@ spectrum_cs_config(struct pcmcia_device *link)/* We initialize the hermes structure before completing PCMCIA * configuration just in case the interrupt handler gets * called. */ - mem =ioport_map (link->io.BasePort1, link->io.NumPorts1); + mem =ioport_map (link->resource[0 ]->start, +resource_size (link->resource[0 ]));if (!mem) goto failed;
@@ -346,7 +347,7 @@ spectrum_cs_config(struct pcmcia_device *link) }/* Register an interface with the stack */ -if (orinoco_if_add (priv, link->io.BasePort1, +if (orinoco_if_add (priv, link->resource[0 ]->start, link->irq,NULL ) !=0 ) { printk(KERN_ERR PFX "orinoco_if_add() failed\n"); goto failed;
drivers/net/wireless/wl3501_cs.c +1 -1
@@ -1960,7 +1960,7 @@ static int wl3501_config(struct pcmcia_device *link) goto failed; dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start;SET_NETDEV_DEV (dev, &link->dev);if (register_netdev (dev)) {printk (KERN_NOTICE "wl3501_cs: register_netdev() failed\n" );
drivers/parport/parport_cs.c +4 -2
@@ -177,12 +177,14 @@ static int parport_config(struct pcmcia_device *link)if (ret) goto failed; - p =parport_pc_probe_port (link->io.BasePort1, link->io.BasePort2, + p =parport_pc_probe_port (link->resource[0 ]->start, + link->resource[1 ]->start, link->irq,PARPORT_DMA_NONE , &link->dev,IRQF_SHARED );if (p ==NULL ) {printk (KERN_NOTICE "parport_cs: parport_pc_probe_port() at " -"0x%3x, irq %u failed\n" , link->io.BasePort1, +"0x%3x, irq %u failed\n" , + (unsigned int ) link->resource[0 ]->start, link->irq); goto failed; }
drivers/scsi/pcmcia/aha152x_stub.c +1 -1
@@ -167,7 +167,7 @@ static int aha152x_config_cs(struct pcmcia_device *link)/* Set configuration options for the aha152x driver */ memset (&s,0 ,sizeof (s)); s.conf ="PCMCIA setup" ; - s.io_port = link->io.BasePort1; + s.io_port = link->resource[0 ]->start; s.irq = link->irq; s.scsiid = host_id; s.reconnect = reconnect;
drivers/scsi/pcmcia/fdomain_stub.c +2 -2
@@ -137,10 +137,10 @@ static int fdomain_config(struct pcmcia_device *link) goto failed;/* A bad hack... */ -release_region (link->io.BasePort1, link->io.NumPorts1); +release_region (link->resource[0 ]->start,resource_size (link->resource[0 ]));/* Set configuration options for the fdomain driver */ -sprintf (str,"%d,%d" , link->io.BasePort1, link->irq); +sprintf (str,"%d,%d" , (unsigned int ) link->resource[0 ]->start, link->irq);fdomain_setup (str); host =__fdomain_16x0_detect (&fdomain_driver_template);
drivers/scsi/pcmcia/nsp_cs.c +12 -13
@@ -1719,17 +1719,19 @@ static int nsp_cs_config(struct pcmcia_device *link) goto cs_failed;if (free_ports) { -if (link->io.BasePort1) { -release_region (link->io.BasePort1, link->io.NumPorts1); +if (link->resource[0 ]) { +release_region (link->resource[0 ]->start, + resource_size(link->resource[0]); } -if (link->io.BasePort2) { -release_region (link->io.BasePort2, link->io.NumPorts2); +if (link->resource[1 ]) { +release_region (link->resource[1 ]->start, + resource_size(link->resource[1]); } }/* Set port and IRQ */ - data->BaseAddress = link->io.BasePort1; - data->NumAddress = link->io.NumPorts1; + data->BaseAddress = link->resource[0 ]->start; + data->NumAddress =resurce_size (link->resource[0 ]); data->IrqNumber = link->irq; nsp_dbg(NSP_DEBUG_INIT, "I/O[0x%x+0x%x] IRQ %d",
@@ -1764,13 +1766,10 @@ static int nsp_cs_config(struct pcmcia_device *link)if (link->conf.Attributes &CONF_ENABLE_IRQ ) {printk (", irq %d" , link->irq); } -if (link->io.NumPorts1) { -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1+link->io.NumPorts1-1 ); - } -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2+link->io.NumPorts2-1 ); +if (link->resource[0 ]) +printk (", io %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);if (link->win)printk (", mem 0x%06lx-0x%06lx" , cfg_mem->req.Base, cfg_mem->req.Base+cfg_mem->req.Size-1 );
drivers/scsi/pcmcia/qlogic_stub.c +9 -9
@@ -215,18 +215,18 @@ static int qlogic_config(struct pcmcia_device * link)if ((info->manf_id ==MANFID_MACNICA ) || (info->manf_id ==MANFID_PIONEER ) || (info->manf_id ==0x0098 )) {/* set ATAcmd */ -outb (0xb4 , link->io.BasePort1 +0xd ); -outb (0x24 , link->io.BasePort1 +0x9 ); -outb (0x04 , link->io.BasePort1 +0xd ); +outb (0xb4 , link->resource[0 ]->start +0xd ); +outb (0x24 , link->resource[0 ]->start +0x9 ); +outb (0x04 , link->resource[0 ]->start +0xd ); }/* The KXL-810AN has a bigger IO port window */ -if (link->io.NumPorts1 ==32 ) +if (resource_size (link->resource[0 ]) ==32 ) host =qlogic_detect (&qlogicfas_driver_template, link, - link->io.BasePort1 +16 , link->irq); + link->resource[0 ]->start +16 , link->irq);else host =qlogic_detect (&qlogicfas_driver_template, link, - link->io.BasePort1, link->irq); + link->resource[0 ]->start, link->irq);if (!host) {printk (KERN_INFO "%s: no SCSI devices found\n" , qlogic_name);
@@ -268,9 +268,9 @@ static int qlogic_resume(struct pcmcia_device *link)if ((info->manf_id ==MANFID_MACNICA ) || (info->manf_id ==MANFID_PIONEER ) || (info->manf_id ==0x0098 )) { -outb (0x80 , link->io.BasePort1 +0xd ); -outb (0x24 , link->io.BasePort1 +0x9 ); -outb (0x04 , link->io.BasePort1 +0xd ); +outb (0x80 , link->resource[0 ]->start +0xd ); +outb (0x24 , link->resource[0 ]->start +0x9 ); +outb (0x04 , link->resource[0 ]->start +0xd ); }/* Ugggglllyyyy!!! */ qlogicfas408_bus_reset (NULL );
drivers/scsi/pcmcia/sym53c500_cs.c +8 -8
@@ -733,9 +733,9 @@ SYM53C500_config(struct pcmcia_device *link) (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) {/* set ATAcmd */ -outb (0xb4 , link->io.BasePort1 +0xd ); -outb (0x24 , link->io.BasePort1 +0x9 ); -outb (0x04 , link->io.BasePort1 +0xd ); +outb (0xb4 , link->resource[0 ]->start +0xd ); +outb (0x24 , link->resource[0 ]->start +0x9 ); +outb (0x04 , link->resource[0 ]->start +0xd ); }/*
@@ -748,7 +748,7 @@ SYM53C500_config(struct pcmcia_device *link)* 0x130, 0x230, 0x280, 0x290, * 0x320, 0x330, 0x340, 0x350 */ - port_base = link->io.BasePort1; + port_base = link->resource[0 ]->start; irq_level = link->irq; DEB(printk("SYM53C500: port_base=0x%x, irq=%d, fast_pio=%d\n",
@@ -821,15 +821,15 @@ static int sym53c500_resume(struct pcmcia_device *link)if ((info->manf_id ==MANFID_MACNICA ) || (info->manf_id ==MANFID_PIONEER ) || (info->manf_id ==0x0098 )) { -outb (0x80 , link->io.BasePort1 +0xd ); -outb (0x24 , link->io.BasePort1 +0x9 ); -outb (0x04 , link->io.BasePort1 +0xd ); +outb (0x80 , link->resource[0 ]->start +0xd ); +outb (0x24 , link->resource[0 ]->start +0x9 ); +outb (0x04 , link->resource[0 ]->start +0xd ); }/* * If things don't work after a "resume", * this is a good place to start looking. */ -SYM53C500_int_host_reset (link->io.BasePort1); +SYM53C500_int_host_reset (link->resource[0 ]->start);return 0 ; }
drivers/serial/serial_cs.c +11 -11
@@ -463,13 +463,13 @@ static int simple_config(struct pcmcia_device *link)/* If the card is already configured, look up the port and irq */ if (link->function_config) {unsigned int port =0 ; -if ((link->io.BasePort2 !=0 ) && - (link->io.NumPorts2 ==8 )) { - port = link->io.BasePort2; +if ((link->resource[1 ]->end !=0 ) && + (resource_size (link->resource[1 ]) ==8 )) { + port = link->resource[1 ]->end; info->slave =1 ; }else if ((info->manfid ==MANFID_OSITECH ) && - (link->io.NumPorts1 ==0x40 )) { - port = link->io.BasePort1 +0x28 ; + (resource_size (link->resource[0 ]) ==0x40 )) { + port = link->resource[0 ]->start +0x28 ; info->slave =1 ; }if (info->slave) {
@@ -507,7 +507,7 @@ found_port: i =pcmcia_request_configuration (link, &link->conf);if (i !=0 )return -1 ; -return setup_serial (link, info, link->io.BasePort1, link->irq); +return setup_serial (link, info, link->resource[0 ]->start, link->irq); } static int multi_config_check(struct pcmcia_device *p_dev,
@@ -524,7 +524,7 @@ static int multi_config_check(struct pcmcia_device *p_dev, p_dev->io.BasePort1 = cf->io.win[0 ].base; p_dev->io.IOAddrLines = cf->io.flags &CISTPL_IO_LINES_MASK ;if (!pcmcia_request_io (p_dev, &p_dev->io)) { - *base2 = p_dev->io.BasePort1 +8 ; + *base2 = p_dev->resource[0 ]->start +8 ;return 0 ; } }
@@ -544,7 +544,7 @@ static int multi_config_check_notpicky(struct pcmcia_device *p_dev, p_dev->io.BasePort2 = cf->io.win[1 ].base; p_dev->io.IOAddrLines = cf->io.flags &CISTPL_IO_LINES_MASK ;if (!pcmcia_request_io (p_dev, &p_dev->io)) { - *base2 = p_dev->io.BasePort2; + *base2 = p_dev->resource[1 ]->start;return 0 ; } }
@@ -596,9 +596,9 @@ static int multi_config(struct pcmcia_device *link) link->conf.ConfigIndex == 3) { err = setup_serial(link, info, base2, link->irq); - base2 = link->io.BasePort1; + base2 = link->resource[0]->start;; } else { - err =setup_serial (link, info, link->io.BasePort1, + err =setup_serial (link, info, link->resource[0 ]->start, link->irq); } info->c950ctrl = base2;
@@ -613,7 +613,7 @@ static int multi_config(struct pcmcia_device *link)return 0 ; } -setup_serial (link, info, link->io.BasePort1, link->irq); +setup_serial (link, info, link->resource[0 ]->start, link->irq);for (i =0 ; i < info->multi -1 ; i++)setup_serial (link, info, base2 + (8 * i), link->irq);
drivers/staging/comedi/drivers/cb_das16_cs.c +5 -7
@@ -170,7 +170,7 @@ static int das16cs_attach(struct comedi_device *dev,if (!link)return -EIO ; - dev->iobase = link->io.BasePort1; + dev->iobase = link->resource[0 ]->start;;printk ("I/O base=0x%04lx " , dev->iobase);printk ("fingerprint:\n" );
@@ -787,12 +787,10 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)dev_info (&link->dev,"index 0x%02x" , link->conf.ConfigIndex);if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %u" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1 + link->io.NumPorts1 -1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2 + link->io.NumPorts2 -1 ); +if (link->resource[0 ]) +printk (", io %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (", io %pR" , link->resource[1 ]);printk ("\n" );return ;
drivers/staging/comedi/drivers/das08_cs.c +5 -7
@@ -88,7 +88,7 @@ static int das08_cs_attach(struct comedi_device *dev,printk (" no pcmcia cards found\n" );return -EIO ; } - iobase = link->io.BasePort1; + iobase = link->resource[0 ]->start; }else {printk (" bug! board does not have PCMCIA bustype\n" );return -EINVAL ;
@@ -283,12 +283,10 @@ static void das08_pcmcia_config(struct pcmcia_device *link)dev_info (&link->dev,"index 0x%02x" , link->conf.ConfigIndex);if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %u" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1 + link->io.NumPorts1 -1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2 + link->io.NumPorts2 -1 ); +if (link->resource[0 ]) +printk (", io %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);printk ("\n" );return ;
drivers/staging/comedi/drivers/ni_daq_700.c +5 -7
@@ -376,7 +376,7 @@ static int dio700_attach(struct comedi_device *dev, struct comedi_devconfig *it) link = pcmcia_cur_dev;/* XXX hack */ if (!link)return -EIO ; - iobase = link->io.BasePort1; + iobase = link->resource[0 ]->start;#ifdef incomplete irq = link->irq;#endif
@@ -644,12 +644,10 @@ static void dio700_config(struct pcmcia_device *link)dev_info (&link->dev,"index 0x%02x" , link->conf.ConfigIndex);if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %d" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1 + link->io.NumPorts1 -1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2 + link->io.NumPorts2 -1 ); +if (link->resource[0 ]) +printk (", io %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);if (link->win)printk (", mem 0x%06lx-0x%06lx" , req.Base, req.Base + req.Size -1 );
drivers/staging/comedi/drivers/ni_daq_dio24.c +5 -7
@@ -128,7 +128,7 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it) link = pcmcia_cur_dev;/* XXX hack */ if (!link)return -EIO ; - iobase = link->io.BasePort1; + iobase = link->resource[0 ]->start;#ifdef incomplete irq = link->irq;#endif
@@ -396,12 +396,10 @@ static void dio24_config(struct pcmcia_device *link)dev_info (&link->dev,"index 0x%02x" , link->conf.ConfigIndex);if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %d" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1 + link->io.NumPorts1 -1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2 + link->io.NumPorts2 -1 ); +if (link->resource[0 ]) +printk (" & %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);if (link->win)printk (", mem 0x%06lx-0x%06lx" , req.Base, req.Base + req.Size -1 );
drivers/staging/comedi/drivers/ni_labpc_cs.c +5 -7
@@ -142,7 +142,7 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it) link = pcmcia_cur_dev;/* XXX hack */ if (!link)return -EIO ; - iobase = link->io.BasePort1; + iobase = link->resource[0 ]->start; irq = link->irq;break ;default :
@@ -373,12 +373,10 @@ static void labpc_config(struct pcmcia_device *link)dev_info (&link->dev,"index 0x%02x" , link->conf.ConfigIndex);if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %d" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1 + link->io.NumPorts1 -1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2 + link->io.NumPorts2 -1 ); +if (link->resource[0 ]) +printk (" & %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);if (link->win)printk (", mem 0x%06lx-0x%06lx" , req.Base, req.Base + req.Size -1 );
drivers/staging/comedi/drivers/ni_mio_cs.c +1 -1
@@ -355,7 +355,7 @@ static int mio_cs_attach(struct comedi_device *dev, struct comedi_devconfig *it)return -EIO ; dev->driver = &driver_ni_mio_cs; - dev->iobase = link->io.BasePort1; + dev->iobase = link->resource[0 ]->start; irq = link->irq;
drivers/staging/comedi/drivers/quatech_daqp_cs.c +5 -7
@@ -871,7 +871,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it) } } - dev->iobase = local->link->io.BasePort1; + dev->iobase = local->link->resource[0 ]->start; ret =alloc_subdevices (dev,4 );if (ret <0 )
@@ -1153,12 +1153,10 @@ static void daqp_cs_config(struct pcmcia_device *link)dev_info (&link->dev,"index 0x%02x" , link->conf.ConfigIndex);if (link->conf.Attributes &CONF_ENABLE_IRQ )printk (", irq %u" , link->irq); -if (link->io.NumPorts1) -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1 + link->io.NumPorts1 -1 ); -if (link->io.NumPorts2) -printk (" & 0x%04x-0x%04x" , link->io.BasePort2, - link->io.BasePort2 + link->io.NumPorts2 -1 ); +if (link->resource[0 ]) +printk (" & %pR" , link->resource[0 ]); +if (link->resource[1 ]) +printk (" & %pR" , link->resource[1 ]);printk ("\n" );return ;
drivers/staging/wlags49_h2/wl_cs.c +1 -1
@@ -319,7 +319,7 @@ void wl_adapter_insert( struct pcmcia_device *link ) goto failed; dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->base_addr = link->resource[0 ]->start;SET_NETDEV_DEV (dev, &link->dev);if (register_netdev (dev) !=0 ) {
drivers/telephony/ixj_pcmcia.c +2 -1
@@ -150,7 +150,8 @@ static int ixj_config(struct pcmcia_device * link)/* * Register the card with the core. */ - j =ixj_pcmcia_probe (link->io.BasePort1, link->io.BasePort1 +0x10 ); + j =ixj_pcmcia_probe (link->resource[0 ]->start, + link->resource[0 ]->start +0x10 ); info->ndev =1 ;ixj_get_serial (link, j);
drivers/usb/host/sl811_cs.c +3 -4
@@ -189,7 +189,7 @@ static int sl811_cs_config(struct pcmcia_device *link) goto failed;/* require an IRQ and two registers */ -if (!link->io.NumPorts1 || link->io.NumPorts1 <2 ) +if (resource_size (link->resource[0 ]) <2 ) goto failed;if (!link->irq)
@@ -204,11 +204,10 @@ static int sl811_cs_config(struct pcmcia_device *link)if (link->conf.Vpp)printk (", Vpp %d.%d" , link->conf.Vpp/10 , link->conf.Vpp%10 );printk (", irq %d" , link->irq); -printk (", io 0x%04x-0x%04x" , link->io.BasePort1, - link->io.BasePort1+link->io.NumPorts1-1 ); +printk (", io %pR" , link->resource[0 ]);printk ("\n" ); -if (sl811_hc_init (parent, link->io.BasePort1, link->irq) +if (sl811_hc_init (parent, link->resource[0 ]->start, link->irq) <0 ) { failed:printk (KERN_WARNING "sl811_cs_config failed\n" );
sound/pcmcia/pdaudiocf/pdaudiocf.c +2 -1
@@ -231,7 +231,8 @@ static int pdacf_config(struct pcmcia_device *link)if (ret) goto failed; -if (snd_pdacf_assign_resources (pdacf, link->io.BasePort1, link->irq) <0 ) +if (snd_pdacf_assign_resources (pdacf, link->resource[0 ]->start, + link->irq) <0 ) goto failed;return 0 ;
sound/pcmcia/vx/vxpocket.c +2 -1
@@ -241,7 +241,8 @@ static int vxpocket_config(struct pcmcia_device *link) chip->dev = &link->dev;snd_card_set_dev (chip->card, chip->dev); -if (snd_vxpocket_assign_resources (chip, link->io.BasePort1, link->irq) <0 ) +if (snd_vxpocket_assign_resources (chip, link->resource[0 ]->start, + link->irq) <0 ) goto failed;return 0 ;
Signature · 6 lines
1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/11 pcmcia: do not use io_req_t when calling pcmcia_request_io()
In reply to a message not in the archiveInstead of io_req_t, drivers are now requested to fill out struct pcmcia_device *p_dev->resource[0,1] for up to two ioport ranges. After a call to pcmcia_request_io(), the ports found there are reserved, after calling pcmcia_request_configuration(), they may be used.
--- Documentation/pcmcia/driver-changes.txt | 7 ++++ drivers/ata/pata_pcmcia.c | 29 ++++++++------- drivers/bluetooth/bluecard_cs.c | 13 +++---- drivers/bluetooth/bt3c_cs.c | 18 +++++----- drivers/bluetooth/btuart_cs.c | 18 +++++----- drivers/bluetooth/dtl1_cs.c | 21 +++++------ drivers/char/pcmcia/cm4000_cs.c | 17 +++------ drivers/char/pcmcia/cm4040_cs.c | 20 +++------- drivers/char/pcmcia/ipwireless/main.c | 10 +++--- drivers/char/pcmcia/synclink_cs.c | 21 +++++------ drivers/ide/ide-cs.c | 30 ++++++++------- drivers/isdn/hardware/avm/avm_cs.c | 15 +++----- drivers/isdn/hisax/avma1_cs.c | 20 ++++------ drivers/isdn/hisax/elsa_cs.c | 15 ++++---- drivers/isdn/hisax/sedlbauer_cs.c | 28 +++++++-------- drivers/isdn/hisax/teles_cs.c | 15 ++++---- drivers/net/pcmcia/3c574_cs.c | 11 +++--- drivers/net/pcmcia/3c589_cs.c | 11 +++--- drivers/net/pcmcia/axnet_cs.c | 40 +++++++++++---------- drivers/net/pcmcia/com20020_cs.c | 19 ++++++---- drivers/net/pcmcia/fmvj18x_cs.c | 31 ++++++++-------- drivers/net/pcmcia/ibmtr_cs.c | 14 ++++---- drivers/net/pcmcia/nmclan_cs.c | 8 ++-- drivers/net/pcmcia/pcnet_cs.c | 40 +++++++++++---------- drivers/net/pcmcia/smc91c92_cs.c | 43 +++++++++++----------- drivers/net/pcmcia/xirc2ps_cs.c | 34 +++++++++--------- drivers/net/wireless/airo_cs.c | 22 +++++------ drivers/net/wireless/atmel_cs.c | 22 +++++------ drivers/net/wireless/b43/pcmcia.c | 4 -- drivers/net/wireless/hostap/hostap_cs.c | 28 ++++++--------- drivers/net/wireless/libertas/if_cs.c | 8 ++-- drivers/net/wireless/orinoco/orinoco_cs.c | 24 ++++++------- drivers/net/wireless/orinoco/spectrum_cs.c | 24 ++++++------- drivers/net/wireless/ray_cs.c | 5 +-- drivers/net/wireless/wl3501_cs.c | 12 +++--- drivers/parport/parport_cs.c | 16 ++++---- drivers/pcmcia/pcmcia_resource.c | 37 +++++-------------- drivers/scsi/pcmcia/aha152x_stub.c | 14 ++++---- drivers/scsi/pcmcia/fdomain_stub.c | 10 +++--- drivers/scsi/pcmcia/nsp_cs.c | 30 +++++++-------- drivers/scsi/pcmcia/qlogic_stub.c | 14 ++++---- drivers/scsi/pcmcia/sym53c500_cs.c | 14 ++++---- drivers/serial/serial_cs.c | 37 ++++++++++--------- drivers/staging/comedi/drivers/cb_das16_cs.c | 24 ++++++------- drivers/staging/comedi/drivers/das08_cs.c | 23 ++++++------ drivers/staging/comedi/drivers/ni_daq_700.c | 24 ++++++------- drivers/staging/comedi/drivers/ni_daq_dio24.c | 24 ++++++------- drivers/staging/comedi/drivers/ni_labpc_cs.c | 24 ++++++------- drivers/staging/comedi/drivers/ni_mio_cs.c | 13 +++---- drivers/staging/comedi/drivers/quatech_daqp_cs.c | 24 ++++++------- drivers/staging/wlags49_h2/wl_cs.c | 8 ++-- drivers/telephony/ixj_pcmcia.c | 16 ++++---- drivers/usb/host/sl811_cs.c | 12 +++--- include/pcmcia/cs.h | 17 --------- include/pcmcia/ds.h | 21 ++++++++++- sound/pcmcia/pdaudiocf/pdaudiocf.c | 6 ++-- sound/pcmcia/vx/vxpocket.c | 6 ++-- 57 files changed, 527 insertions(+), 584 deletions(-)
Documentation/pcmcia/driver-changes.txt +7 -0
@@ -1,4 +1,11 @@ This file details changes in 2.6 which affect PCMCIA card driver authors: +* pcmcia_request_io changes (as of 2.6.36) + Instead of io_req_t, drivers are now requested to fill out + struct pcmcia_device *p_dev->resource[0,1] for up to two ioport + ranges. After a call to pcmcia_request_io(), the ports found there + are reserved, after calling pcmcia_request_configuration(), they may + be used. + * No dev_info_t, no cs_types.h (as of 2.6.36) dev_info_t and a few other typedefs are removed. No longer use them in PCMCIA device drivers. Also, do not include pcmcia/cs_types.h, as
drivers/ata/pata_pcmcia.c +15 -14
@@ -200,21 +200,23 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - pdev->io.BasePort1 = io->win[0 ].base; - pdev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; -if (!(io->flags &CISTPL_IO_16BIT )) - pdev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; + pdev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + pdev->resource[0 ]->start = io->win[0 ].base; +if (!(io->flags &CISTPL_IO_16BIT )) { + pdev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + pdev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + }if (io->nwin ==2 ) { - pdev->io.NumPorts1 =8 ; - pdev->io.BasePort2 = io->win[1 ].base; - pdev->io.NumPorts2 = (stk->is_kme) ?2 :1 ; -if (pcmcia_request_io (pdev, &pdev->io) !=0 ) + pdev->resource[0 ]->end =8 ; + pdev->resource[1 ]->start = io->win[1 ].base; + pdev->resource[1 ]->end = (stk->is_kme) ?2 :1 ; +if (pcmcia_request_io (pdev) !=0 )return -ENODEV ; stk->ctl_base = pdev->resource[1 ]->start; }else if ((io->nwin ==1 ) && (io->win[0 ].len >=16 )) { - pdev->io.NumPorts1 = io->win[0 ].len; - pdev->io.NumPorts2 =0 ; -if (pcmcia_request_io (pdev, &pdev->io) !=0 ) + pdev->resource[0 ]->end = io->win[0 ].len; + pdev->resource[1 ]->end =0 ; +if (pcmcia_request_io (pdev) !=0 )return -ENODEV ; stk->ctl_base = pdev->resource[0 ]->start +0x0e ; }else
@@ -245,9 +247,8 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)struct ata_port_operations *ops = &pcmcia_port_ops;/* Set up attributes in order to probe card and get resources */ - pdev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - pdev->io.Attributes2 =IO_DATA_PATH_WIDTH_8 ; - pdev->io.IOAddrLines =3 ; + pdev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; + pdev->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_8 ; pdev->conf.Attributes =CONF_ENABLE_IRQ ; pdev->conf.IntType =INT_MEMORY_AND_IO ;
drivers/bluetooth/bluecard_cs.c +6 -7
@@ -865,9 +865,6 @@ static int bluecard_probe(struct pcmcia_device *link) info->p_dev = link; link->priv = info; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - link->io.NumPorts1 =8 ; - link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -890,12 +887,14 @@ static int bluecard_config(struct pcmcia_device *link)int i, n; link->conf.ConfigIndex =0x20 ; - link->io.NumPorts1 =64 ; - link->io.IOAddrLines =6 ; + + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + link->resource[0 ]->end =64 ; + link->io_lines =6 ;for (n =0 ; n <0x400 ; n +=0x40 ) { - link->io.BasePort1 = n ^0x300 ; - i =pcmcia_request_io (link, &link->io); + link->resource[0 ]->start = n ^0x300 ; + i =pcmcia_request_io (link);if (i ==0 )break ; }
drivers/bluetooth/bt3c_cs.c +9 -9
@@ -657,8 +657,8 @@ static int bt3c_probe(struct pcmcia_device *link) info->p_dev = link; link->priv = info; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - link->io.NumPorts1 =8 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + link->resource[0 ]->end =8 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -683,14 +683,14 @@ static int bt3c_check_config(struct pcmcia_device *p_dev, {unsigned long try = (unsigned long ) priv_data; + p_dev->io_lines = (try ==0 ) ?16 : cf->io.flags &CISTPL_IO_LINES_MASK ; +if (cf->vpp1.present & (1 <<CISTPL_POWER_VNOM )) p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM ] /10000 ;if ((cf->io.nwin >0 ) && (cf->io.win[0 ].len ==8 ) && (cf->io.win[0 ].base !=0 )) { - p_dev->io.BasePort1 = cf->io.win[0 ].base; - p_dev->io.IOAddrLines = (try ==0 ) ?16 : - cf->io.flags &CISTPL_IO_LINES_MASK ; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[0 ]->start = cf->io.win[0 ].base; +if (!pcmcia_request_io (p_dev))return 0 ; }return -ENODEV ;
@@ -707,9 +707,9 @@ static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,if ((cf->io.nwin >0 ) && ((cf->io.flags &CISTPL_IO_LINES_MASK ) <=3 )) {for (j =0 ; j <5 ; j++) { - p_dev->io.BasePort1 = base[j]; - p_dev->io.IOAddrLines = base[j] ?16 :3 ; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[0 ]->start = base[j]; + p_dev->io_lines = base[j] ?16 :3 ; +if (!pcmcia_request_io (p_dev))return 0 ; } }
drivers/bluetooth/btuart_cs.c +9 -9
@@ -586,8 +586,8 @@ static int btuart_probe(struct pcmcia_device *link) info->p_dev = link; link->priv = info; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - link->io.NumPorts1 =8 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + link->resource[0 ]->end =8 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -612,14 +612,14 @@ static int btuart_check_config(struct pcmcia_device *p_dev, {int *try = priv_data; + p_dev->io_lines = (try ==0 ) ?16 : cf->io.flags &CISTPL_IO_LINES_MASK ; +if (cf->vpp1.present & (1 <<CISTPL_POWER_VNOM )) p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM ] /10000 ;if ((cf->io.nwin >0 ) && (cf->io.win[0 ].len ==8 ) && (cf->io.win[0 ].base !=0 )) { - p_dev->io.BasePort1 = cf->io.win[0 ].base; - p_dev->io.IOAddrLines = (*try ==0 ) ?16 : - cf->io.flags &CISTPL_IO_LINES_MASK ; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[0 ]->start = cf->io.win[0 ].base; +if (!pcmcia_request_io (p_dev))return 0 ; }return -ENODEV ;
@@ -636,9 +636,9 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,if ((cf->io.nwin >0 ) && ((cf->io.flags &CISTPL_IO_LINES_MASK ) <=3 )) {for (j =0 ; j <5 ; j++) { - p_dev->io.BasePort1 = base[j]; - p_dev->io.IOAddrLines = base[j] ?16 :3 ; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[0 ]->start = base[j]; + p_dev->io_lines = base[j] ?16 :3 ; +if (!pcmcia_request_io (p_dev))return 0 ; } }
drivers/bluetooth/dtl1_cs.c +10 -11
@@ -572,8 +572,8 @@ static int dtl1_probe(struct pcmcia_device *link) info->p_dev = link; link->priv = info; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - link->io.NumPorts1 =8 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + link->resource[0 ]->end =8 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -597,14 +597,13 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev, unsigned int vcc, void *priv_data) { -if ((cf->io.nwin ==1 ) && (cf->io.win[0 ].len >8 )) { - p_dev->io.BasePort1 = cf->io.win[0 ].base; - p_dev->io.NumPorts1 = cf->io.win[0 ].len;/*yo */ - p_dev->io.IOAddrLines = cf->io.flags &CISTPL_IO_LINES_MASK ; -if (!pcmcia_request_io (p_dev, &p_dev->io)) -return 0 ; - } -return -ENODEV ; +if ((cf->io.nwin !=1 ) || (cf->io.win[0 ].len <=8 )) +return -ENODEV ; + + p_dev->resource[0 ]->start = cf->io.win[0 ].base; + p_dev->resource[0 ]->end = cf->io.win[0 ].len;/*yo */ + p_dev->io_lines = cf->io.flags &CISTPL_IO_LINES_MASK ; +return pcmcia_request_io (p_dev); }static int dtl1_config (struct pcmcia_device *link)
@@ -613,7 +612,7 @@ static int dtl1_config(struct pcmcia_device *link)int i;/* Look for a generic full-sized window */ - link->io.NumPorts1 =8 ; + link->resource[0 ]->end =8 ;if (pcmcia_loop_config (link, dtl1_confcheck,NULL ) <0 ) goto failed;
drivers/char/pcmcia/cm4000_cs.c +6 -11
@@ -1751,17 +1751,12 @@ static int cm4000_config_check(struct pcmcia_device *p_dev,if (!cfg->io.nwin)return -ENODEV ; -/* Get the IOaddr */ - p_dev->io.BasePort1 = cfg->io.win[0 ].base; - p_dev->io.NumPorts1 = cfg->io.win[0 ].len; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(cfg->io.flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(cfg->io.flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = cfg->io.flags &CISTPL_IO_LINES_MASK ; - -return pcmcia_request_io (p_dev, &p_dev->io); + p_dev->resource[0 ]->start = cfg->io.win[0 ].base; + p_dev->resource[0 ]->end = cfg->io.win[0 ].len; + p_dev->resource[0 ]->flags |=pcmcia_io_cfg_data_width (cfg->io.flags); + p_dev->io_lines = cfg->io.flags &CISTPL_IO_LINES_MASK ; + +return pcmcia_request_io (p_dev); }static int cm4000_config (struct pcmcia_device * link,int devno)
drivers/char/pcmcia/cm4040_cs.c +6 -14
@@ -527,16 +527,12 @@ static int cm4040_config_check(struct pcmcia_device *p_dev,return -ENODEV ;/* Get the IOaddr */ - p_dev->io.BasePort1 = cfg->io.win[0 ].base; - p_dev->io.NumPorts1 = cfg->io.win[0 ].len; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(cfg->io.flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(cfg->io.flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = cfg->io.flags &CISTPL_IO_LINES_MASK ; - - rc =pcmcia_request_io (p_dev, &p_dev->io); + p_dev->resource[0 ]->start = cfg->io.win[0 ].base; + p_dev->resource[0 ]->end = cfg->io.win[0 ].len; + p_dev->resource[0 ]->flags |=pcmcia_io_cfg_data_width (cfg->io.flags); + p_dev->io_lines = cfg->io.flags &CISTPL_IO_LINES_MASK ; + rc =pcmcia_request_io (p_dev); +dev_printk (KERN_INFO , &p_dev->dev,"pcmcia_request_io returned 0x%x\n" , rc);return rc;
@@ -548,10 +544,6 @@ static int reader_config(struct pcmcia_device *link, int devno)struct reader_dev *dev;int fail_rc; - link->io.BasePort2 =0 ; - link->io.NumPorts2 =0 ; - link->io.Attributes2 =0 ; -if (pcmcia_loop_config (link, cm4040_config_check,NULL )) goto cs_release;
drivers/char/pcmcia/ipwireless/main.c +5 -5
@@ -88,15 +88,15 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,memreq_t memreq_common_memory;int ret; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - p_dev->io.BasePort1 = cfg->io.win[0 ].base; - p_dev->io.NumPorts1 = cfg->io.win[0 ].len; - p_dev->io.IOAddrLines =16 ; + p_dev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; + p_dev->resource[0 ]->start = cfg->io.win[0 ].base; + p_dev->resource[0 ]->end = cfg->io.win[0 ].len;/* 0x40 causes it to generate level mode interrupts. */ /* 0x04 enables IREQ pin. */ p_dev->conf.ConfigIndex = cfg->index |0x44 ; - ret =pcmcia_request_io (p_dev, &p_dev->io); + p_dev->io_lines =16 ; + ret =pcmcia_request_io (p_dev);if (ret)return ret;
drivers/char/pcmcia/synclink_cs.c +9 -12
@@ -571,18 +571,15 @@ static int mgslpc_ioprobe(struct pcmcia_device *p_dev, unsigned int vcc, void *priv_data) { -if (cfg->io.nwin >0 ) { - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(cfg->io.flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(cfg->io.flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = cfg->io.flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = cfg->io.win[0 ].base; - p_dev->io.NumPorts1 = cfg->io.win[0 ].len; -return pcmcia_request_io (p_dev, &p_dev->io); - } -return -ENODEV ; +if (!cfg->io.nwin) +return -ENODEV ; + + p_dev->resource[0 ]->start = cfg->io.win[0 ].base; + p_dev->resource[0 ]->end = cfg->io.win[0 ].len; + p_dev->resource[0 ]->flags |=pcmcia_io_cfg_data_width (cfg->io.flags); + p_dev->io_lines = cfg->io.flags &CISTPL_IO_LINES_MASK ; + +return pcmcia_request_io (p_dev); }static int mgslpc_config (struct pcmcia_device *link)
drivers/ide/ide-cs.c +16 -14
@@ -97,9 +97,8 @@ static int ide_probe(struct pcmcia_device *link) info->p_dev = link; link->priv = info; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.Attributes2 =IO_DATA_PATH_WIDTH_8 ; - link->io.IOAddrLines =3 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; + link->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_8 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -228,22 +227,25 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; + pdev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + pdev->conf.ConfigIndex = cfg->index; - pdev->io.BasePort1 = io->win[0 ].base; - pdev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; -if (!(io->flags &CISTPL_IO_16BIT )) - pdev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; + pdev->resource[0 ]->start = io->win[0 ].base; +if (!(io->flags &CISTPL_IO_16BIT )) { + pdev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + pdev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + }if (io->nwin ==2 ) { - pdev->io.NumPorts1 =8 ; - pdev->io.BasePort2 = io->win[1 ].base; - pdev->io.NumPorts2 = (stk->is_kme) ?2 :1 ; -if (pcmcia_request_io (pdev, &pdev->io) !=0 ) + pdev->resource[0 ]->end =8 ; + pdev->resource[1 ]->start = io->win[1 ].base; + pdev->resource[1 ]->end = (stk->is_kme) ?2 :1 ; +if (pcmcia_request_io (pdev) !=0 )return -ENODEV ; stk->ctl_base = pdev->resource[1 ]->start; }else if ((io->nwin ==1 ) && (io->win[0 ].len >=16 )) { - pdev->io.NumPorts1 = io->win[0 ].len; - pdev->io.NumPorts2 =0 ; -if (pcmcia_request_io (pdev, &pdev->io) !=0 ) + pdev->resource[0 ]->end = io->win[0 ].len; + pdev->resource[1 ]->end =0 ; +if (pcmcia_request_io (pdev) !=0 )return -ENODEV ; stk->ctl_base = pdev->resource[1 ]->start +0x0e ; }else
drivers/isdn/hardware/avm/avm_cs.c +5 -10
@@ -75,9 +75,8 @@ static int avmcs_probe(struct pcmcia_device *p_dev) {/* The io structure describes IO port mapping */ - p_dev->io.NumPorts1 =16 ; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end =16 ; + p_dev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ;/* General socket configuration */ p_dev->conf.Attributes =CONF_ENABLE_IRQ ;
@@ -119,13 +118,9 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev,if (cf->io.nwin <=0 )return -ENODEV ; - p_dev->io.BasePort1 = cf->io.win[0 ].base; - p_dev->io.NumPorts1 = cf->io.win[0 ].len; - p_dev->io.NumPorts2 =0 ; -printk (KERN_INFO "avm_cs: testing i/o %#x-%#x\n" , - p_dev->io.BasePort1, - p_dev->io.BasePort1+p_dev->io.NumPorts1-1 ); -return pcmcia_request_io (p_dev, &p_dev->io); + p_dev->resource[0 ]->start = cf->io.win[0 ].base; + p_dev->resource[0 ]->end = cf->io.win[0 ].len; +return pcmcia_request_io (p_dev); }static int avmcs_config (struct pcmcia_device *link)
drivers/isdn/hisax/avma1_cs.c +8 -12
@@ -78,11 +78,10 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)dev_dbg (&p_dev->dev,"avma1cs_attach()\n" );/* The io structure describes IO port mapping */ - p_dev->io.NumPorts1 =16 ; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.NumPorts2 =16 ; - p_dev->io.Attributes2 =IO_DATA_PATH_WIDTH_16 ; - p_dev->io.IOAddrLines =5 ; + p_dev->resource[0 ]->end =16 ; + p_dev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + p_dev->resource[1 ]->end =16 ; + p_dev->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_16 ;/* General socket configuration */ p_dev->conf.Attributes =CONF_ENABLE_IRQ ;
@@ -126,13 +125,10 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev,if (cf->io.nwin <=0 )return -ENODEV ; - p_dev->io.BasePort1 = cf->io.win[0 ].base; - p_dev->io.NumPorts1 = cf->io.win[0 ].len; - p_dev->io.NumPorts2 =0 ; -printk (KERN_INFO "avma1_cs: testing i/o %#x-%#x\n" , - p_dev->io.BasePort1, - p_dev->io.BasePort1+p_dev->io.NumPorts1-1 ); -return pcmcia_request_io (p_dev, &p_dev->io); + p_dev->resource[0 ]->start = cf->io.win[0 ].base; + p_dev->resource[0 ]->end = cf->io.win[0 ].len; + p_dev->io_lines =5 ; +return pcmcia_request_io (p_dev); }
drivers/isdn/hisax/elsa_cs.c +8 -7
@@ -126,9 +126,8 @@ static int __devinit elsa_cs_probe(struct pcmcia_device *link)and attributes of IO windows) are fixed by the nature of the device, and can be hard-wired here. */ - link->io.NumPorts1 =8 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.IOAddrLines =3 ; + link->resource[0 ]->end =8 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -173,16 +172,18 @@ static int elsa_cs_configcheck(struct pcmcia_device *p_dev, {int j; + p_dev->io_lines =3 ; +if ((cf->io.nwin >0 ) && cf->io.win[0 ].base) {printk (KERN_INFO "(elsa_cs: looks like the 96 model)\n" ); - p_dev->io.BasePort1 = cf->io.win[0 ].base; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[0 ]->start = cf->io.win[0 ].base; +if (!pcmcia_request_io (p_dev))return 0 ; }else {printk (KERN_INFO "(elsa_cs: looks like the 97 model)\n" );for (j =0x2f0 ; j >0x100 ; j -=0x10 ) { - p_dev->io.BasePort1 = j; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[0 ]->start = j; +if (!pcmcia_request_io (p_dev))return 0 ; } }
drivers/isdn/hisax/sedlbauer_cs.c +13 -15
@@ -129,9 +129,8 @@ static int __devinit sedlbauer_probe(struct pcmcia_device *link)/* from old sedl_cs */ /* The io structure describes IO port mapping */ - link->io.NumPorts1 =8 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - link->io.IOAddrLines =3 ; + link->resource[0 ]->end =8 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; link->conf.Attributes =0 ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -201,23 +200,22 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags);if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; }/* This reserves IO space but doesn't actually enable it */ -if (pcmcia_request_io (p_dev, &p_dev->io) !=0 ) + p_dev->io_lines =3 ; +if (pcmcia_request_io (p_dev) !=0 )return -ENODEV ; }
drivers/isdn/hisax/teles_cs.c +8 -7
@@ -106,9 +106,8 @@ static int __devinit teles_probe(struct pcmcia_device *link)and attributes of IO windows) are fixed by the nature of the device, and can be hard-wired here. */ - link->io.NumPorts1 =96 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.IOAddrLines =5 ; + link->resource[0 ]->end =96 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -153,16 +152,18 @@ static int teles_cs_configcheck(struct pcmcia_device *p_dev, {int j; + p_dev->io_lines =5 ; +if ((cf->io.nwin >0 ) && cf->io.win[0 ].base) {printk (KERN_INFO "(teles_cs: looks like the 96 model)\n" ); - p_dev->io.BasePort1 = cf->io.win[0 ].base; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[0 ]->start = cf->io.win[0 ].base; +if (!pcmcia_request_io (p_dev))return 0 ; }else {printk (KERN_INFO "(teles_cs: looks like the 97 model)\n" );for (j =0x2f0 ; j >0x100 ; j -=0x10 ) { - p_dev->io.BasePort1 = j; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[0 ]->start = j; +if (!pcmcia_request_io (p_dev))return 0 ; } }
drivers/net/pcmcia/3c574_cs.c +6 -5
@@ -278,8 +278,8 @@ static int tc574_probe(struct pcmcia_device *link) lp->p_dev = link;spin_lock_init (&lp->window_lock); - link->io.NumPorts1 =32 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; + link->resource[0 ]->end =32 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_16 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ; link->conf.ConfigIndex =1 ;
@@ -337,10 +337,11 @@ static int tc574_config(struct pcmcia_device *link)dev_dbg (&link->dev,"3c574_config()\n" ); - link->io.IOAddrLines =16 ; + link->io_lines =16 ; +for (i = j =0 ; j <0x400 ; j +=0x20 ) { - link->io.BasePort1 = j ^0x300 ; - i =pcmcia_request_io (link, &link->io); + link->resource[0 ]->start = j ^0x300 ; + i =pcmcia_request_io (link);if (i ==0 )break ; }
drivers/net/pcmcia/3c589_cs.c +6 -5
@@ -213,8 +213,8 @@ static int tc589_probe(struct pcmcia_device *link) lp->p_dev = link;spin_lock_init (&lp->lock); - link->io.NumPorts1 =16 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; + link->resource[0 ]->end =16 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_16 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -277,12 +277,13 @@ static int tc589_config(struct pcmcia_device *link) "3Com card??\n"); multi = (link->card_id ==PRODID_3COM_3C562 ); + link->io_lines =16 ; +/* For the 3c562, the base address must be xx00-xx7f */ - link->io.IOAddrLines =16 ;for (i = j =0 ; j <0x400 ; j +=0x10 ) {if (multi && (j &0x80 ))continue ; - link->io.BasePort1 = j ^0x300 ; - i =pcmcia_request_io (link, &link->io); + link->resource[0 ]->start = j ^0x300 ; + i =pcmcia_request_io (link);if (i ==0 )break ; }
drivers/net/pcmcia/axnet_cs.c +21 -19
@@ -259,28 +259,30 @@ static int get_prom(struct pcmcia_device *link)static int try_io_port (struct pcmcia_device *link) {int j, ret; -if (link->io.NumPorts1 ==32 ) { - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; + link->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + link->resource[1 ]->flags &= ~IO_DATA_PATH_WIDTH ; +if (link->resource[0 ]->end ==32 ) { + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ;/* for master/slave multifunction cards */ -if (link->io.NumPorts2 >0 ) - link->io.Attributes2 =IO_DATA_PATH_WIDTH_8 ; +if (link->resource[1 ]->end >0 ) + link->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_8 ; }else {/* This should be two 16-port windows */ - link->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - link->io.Attributes2 =IO_DATA_PATH_WIDTH_16 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + link->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_16 ; } -if (link->io.BasePort1 ==0 ) { - link->io.IOAddrLines =16 ; +if (link->resource[0 ]->start ==0 ) {for (j =0 ; j <0x400 ; j +=0x20 ) { - link->io.BasePort1 = j ^0x300 ; - link->io.BasePort2 = (j ^0x300 ) +0x10 ; - ret =pcmcia_request_io (link, &link->io); + link->resource[0 ]->start = j ^0x300 ; + link->resource[1 ]->start = (j ^0x300 ) +0x10 ; + link->io_lines =16 ; + ret =pcmcia_request_io (link);if (ret ==0 )return ret; }return ret; }else { -return pcmcia_request_io (link, &link->io); +return pcmcia_request_io (link); } }
@@ -301,15 +303,15 @@ static int axnet_configcheck(struct pcmcia_device *p_dev,network function with window 0, and serial with window 1 */ if (io->nwin >1 ) { i = (io->win[1 ].len > io->win[0 ].len); - p_dev->io.BasePort2 = io->win[1 -i].base; - p_dev->io.NumPorts2 = io->win[1 -i].len; + p_dev->resource[1 ]->start = io->win[1 -i].base; + p_dev->resource[1 ]->end = io->win[1 -i].len; }else { - i = p_dev->io.NumPorts2 =0 ; + i = p_dev->resource[1 ]->end =0 ; } - p_dev->io.BasePort1 = io->win[i].base; - p_dev->io.NumPorts1 = io->win[i].len; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; -if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >=32 ) + p_dev->resource[0 ]->start = io->win[i].base; + p_dev->resource[0 ]->end = io->win[i].len; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; +if (p_dev->resource[0 ]->end + p_dev->resource[1 ]->end >=32 )return try_io_port (p_dev);return -ENODEV ;
drivers/net/pcmcia/com20020_cs.c +11 -8
@@ -158,9 +158,8 @@ static int com20020_probe(struct pcmcia_device *p_dev)/* fill in our module parameters as defaults */ dev->dev_addr[0 ] = node; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.NumPorts1 =16 ; - p_dev->io.IOAddrLines =16 ; + p_dev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + p_dev->resource[0 ]->end =16 ; p_dev->conf.Attributes =CONF_ENABLE_IRQ ; p_dev->conf.IntType =INT_MEMORY_AND_IO ;
@@ -245,20 +244,24 @@ static int com20020_config(struct pcmcia_device *link)dev_dbg (&link->dev,"com20020_config\n" ); -dev_dbg (&link->dev,"baseport1 is %Xh\n" , link->io.BasePort1); +dev_dbg (&link->dev,"baseport1 is %Xh\n" , + (unsigned int ) link->resource[0 ]->start); + i = -ENODEV ; -if (!link->io.BasePort1) + link->io_lines =16 ; + +if (!link->resource[0 ]->start) {for (ioaddr =0x100 ; ioaddr <0x400 ; ioaddr +=0x10 ) { - link->io.BasePort1 = ioaddr; - i =pcmcia_request_io (link, &link->io); + link->resource[0 ]->start = ioaddr; + i =pcmcia_request_io (link);if (i ==0 )break ; } }else - i =pcmcia_request_io (link, &link->io); + i =pcmcia_request_io (link);if (i !=0 ) {
drivers/net/pcmcia/fmvj18x_cs.c +16 -15
@@ -248,9 +248,8 @@ static int fmvj18x_probe(struct pcmcia_device *link) lp->base =NULL ;/* The io structure describes IO port mapping */ - link->io.NumPorts1 =32 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.IOAddrLines =5 ; + link->resource[0 ]->end =32 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ;/* General socket configuration */ link->conf.Attributes =CONF_ENABLE_IRQ ;
@@ -288,13 +287,13 @@ static int mfc_try_io_port(struct pcmcia_device *link) { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };for (i =0 ; i <5 ; i++) { - link->io.BasePort2 = serial_base[i]; - link->io.Attributes2 =IO_DATA_PATH_WIDTH_8 ; -if (link->io.BasePort2 ==0 ) { - link->io.NumPorts2 =0 ; + link->resource[1 ]->start = serial_base[i]; + link->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_8 ; +if (link->resource[1 ]->start ==0 ) { + link->resource[1 ]->end =0 ;printk (KERN_NOTICE "fmvj18x_cs: out of resource for serial\n" ); } - ret =pcmcia_request_io (link, &link->io); + ret =pcmcia_request_io (link);if (ret ==0 )return ret; }
@@ -310,8 +309,8 @@ static int ungermann_try_io_port(struct pcmcia_device *link)0x380,0x3c0 only for ioport. */ for (ioaddr =0x300 ; ioaddr <0x3e0 ; ioaddr +=0x20 ) { - link->io.BasePort1 = ioaddr; - ret =pcmcia_request_io (link, &link->io); + link->resource[0 ]->start = ioaddr; + ret =pcmcia_request_io (link);if (ret ==0 ) {/* calculate ConfigIndex value */ link->conf.ConfigIndex =
@@ -345,6 +344,8 @@ static int fmvj18x_config(struct pcmcia_device *link)dev_dbg (&link->dev,"fmvj18x_config\n" ); + link->io_lines =5 ; + len =pcmcia_get_tuple (link,CISTPL_FUNCE , &buf);kfree (buf);
@@ -363,20 +364,20 @@ static int fmvj18x_config(struct pcmcia_device *link)/* MultiFunction Card */ link->conf.ConfigBase =0x800 ; link->conf.ConfigIndex =0x47 ; - link->io.NumPorts2 =8 ; + link->resource[1 ]->end =8 ; }break ;case MANFID_NEC : cardtype =NEC ;/* MultiFunction Card */ link->conf.ConfigBase =0x800 ; link->conf.ConfigIndex =0x47 ; - link->io.NumPorts2 =8 ; + link->resource[1 ]->end =8 ;break ;case MANFID_KME : cardtype =KME ;/* MultiFunction Card */ link->conf.ConfigBase =0x800 ; link->conf.ConfigIndex =0x47 ; - link->io.NumPorts2 =8 ; + link->resource[1 ]->end =8 ;break ;case MANFID_CONTEC : cardtype =CONTEC ;
@@ -417,14 +418,14 @@ static int fmvj18x_config(struct pcmcia_device *link) } } -if (link->io.NumPorts2 !=0 ) { +if (link->resource[1 ]->end !=0 ) { ret =mfc_try_io_port (link);if (ret !=0 ) goto failed; }else if (cardtype ==UNGERMANN ) { ret =ungermann_try_io_port (link);if (ret !=0 ) goto failed; }else { - ret =pcmcia_request_io (link, &link->io); + ret =pcmcia_request_io (link);if (ret) goto failed; }
drivers/net/pcmcia/ibmtr_cs.c +7 -7
@@ -151,9 +151,8 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link) link->priv = info; info->ti =netdev_priv (dev); - link->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - link->io.NumPorts1 =4 ; - link->io.IOAddrLines =16 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + link->resource[0 ]->end =4 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ; link->conf.Present =PRESENT_OPTION ;
@@ -218,16 +217,17 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)dev_dbg (&link->dev,"ibmtr_config\n" ); link->conf.ConfigIndex =0x61 ; + link->io_lines =16 ;/* Determine if this is PRIMARY or ALTERNATE. */ /* Try PRIMARY card at 0xA20-0xA23 */ - link->io.BasePort1 =0xA20 ; - i =pcmcia_request_io (link, &link->io); + link->resource[0 ]->start =0xA20 ; + i =pcmcia_request_io (link);if (i !=0 ) {/* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ - link->io.BasePort1 =0xA24 ; - ret =pcmcia_request_io (link, &link->io); + link->resource[0 ]->start =0xA24 ; + ret =pcmcia_request_io (link);if (ret) goto failed; }
drivers/net/pcmcia/nmclan_cs.c +4 -4
@@ -458,9 +458,8 @@ static int nmclan_probe(struct pcmcia_device *link) link->priv = dev;spin_lock_init (&lp->bank_lock); - link->io.NumPorts1 =32 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.IOAddrLines =5 ; + link->resource[0 ]->end =32 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ; link->conf.ConfigIndex =1 ;
@@ -644,7 +643,8 @@ static int nmclan_config(struct pcmcia_device *link)dev_dbg (&link->dev,"nmclan_config\n" ); - ret =pcmcia_request_io (link, &link->io); + link->io_lines =5 ; + ret =pcmcia_request_io (link);if (ret) goto failed; ret =pcmcia_request_exclusive_irq (link, mace_interrupt);
drivers/net/pcmcia/pcnet_cs.c +21 -19
@@ -477,29 +477,31 @@ static hw_info_t *get_hwired(struct pcmcia_device *link)static int try_io_port (struct pcmcia_device *link) {int j, ret; -if (link->io.NumPorts1 ==32 ) { - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (link->io.NumPorts2 >0 ) { + link->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + link->resource[1 ]->flags &= ~IO_DATA_PATH_WIDTH ; +if (link->resource[0 ]->end ==32 ) { + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; +if (link->resource[1 ]->end >0 ) {/* for master/slave multifunction cards */ - link->io.Attributes2 =IO_DATA_PATH_WIDTH_8 ; + link->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_8 ; } }else {/* This should be two 16-port windows */ - link->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - link->io.Attributes2 =IO_DATA_PATH_WIDTH_16 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + link->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_16 ; } -if (link->io.BasePort1 ==0 ) { - link->io.IOAddrLines =16 ; +if (link->resource[0 ]->start ==0 ) {for (j =0 ; j <0x400 ; j +=0x20 ) { - link->io.BasePort1 = j ^0x300 ; - link->io.BasePort2 = (j ^0x300 ) +0x10 ; - ret =pcmcia_request_io (link, &link->io); + link->resource[0 ]->start = j ^0x300 ; + link->resource[1 ]->start = (j ^0x300 ) +0x10 ; + link->io_lines =16 ; + ret =pcmcia_request_io (link);if (ret ==0 )return ret; }return ret; }else { -return pcmcia_request_io (link, &link->io); +return pcmcia_request_io (link); } }
@@ -520,18 +522,18 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev,network function with window 0, and serial with window 1 */ if (io->nwin >1 ) { i = (io->win[1 ].len > io->win[0 ].len); - p_dev->io.BasePort2 = io->win[1 -i].base; - p_dev->io.NumPorts2 = io->win[1 -i].len; + p_dev->resource[1 ]->start = io->win[1 -i].base; + p_dev->resource[1 ]->end = io->win[1 -i].len; }else { - i = p_dev->io.NumPorts2 =0 ; + i = p_dev->resource[1 ]->end =0 ; } *has_shmem = ((cfg->mem.nwin ==1 ) && (cfg->mem.win[0 ].len >=0x4000 )); - p_dev->io.BasePort1 = io->win[i].base; - p_dev->io.NumPorts1 = io->win[i].len; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; -if (p_dev->io.NumPorts1 + p_dev->io.NumPorts2 >=32 ) + p_dev->resource[0 ]->start = io->win[i].base; + p_dev->resource[0 ]->end = io->win[i].len; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; +if (p_dev->resource[0 ]->end + p_dev->resource[1 ]->end >=32 )return try_io_port (p_dev);return 0 ;
drivers/net/pcmcia/smc91c92_cs.c +21 -22
99 lines not on this page · raw message
drivers/net/pcmcia/xirc2ps_cs.c +17 -17
@@ -677,9 +677,9 @@ xirc2ps_config_modem(struct pcmcia_device *p_dev,if (cf->io.nwin >0 && (cf->io.win[0 ].base &0xf ) ==8 ) {for (ioaddr =0x300 ; ioaddr <0x400 ; ioaddr +=0x10 ) { - p_dev->io.BasePort2 = cf->io.win[0 ].base; - p_dev->io.BasePort1 = ioaddr; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[1 ]->start = cf->io.win[0 ].base; + p_dev->resource[0 ]->start = ioaddr; +if (!pcmcia_request_io (p_dev))return 0 ; } }
@@ -696,11 +696,11 @@ xirc2ps_config_check(struct pcmcia_device *p_dev,int *pass = priv_data;if (cf->io.nwin >0 && (cf->io.win[0 ].base &0xf ) ==8 ) { - p_dev->io.BasePort2 = cf->io.win[0 ].base; - p_dev->io.BasePort1 = p_dev->io.BasePort2 + p_dev->resource[1 ]->start = cf->io.win[0 ].base; + p_dev->resource[0 ]->start = p_dev->resource[1 ]->start + (*pass ? (cf->index &0x20 ?-24 :8 ) : (cf->index &0x20 ?8 :-24 )); -if (!pcmcia_request_io (p_dev, &p_dev->io)) +if (!pcmcia_request_io (p_dev))return 0 ; }return -ENODEV ;
@@ -807,8 +807,7 @@ xirc2ps_config(struct pcmcia_device * link) goto failure; } - link->io.IOAddrLines =10 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_16 ;if (local->modem) {int pass;
@@ -816,16 +815,16 @@ xirc2ps_config(struct pcmcia_device * link) link->conf.Attributes |=CONF_ENABLE_SPKR ; link->conf.Status |=CCSR_AUDIO_ENA ; } - link->io.NumPorts2 =8 ; - link->io.Attributes2 =IO_DATA_PATH_WIDTH_8 ; + link->resource[1 ]->end =8 ; + link->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_8 ;if (local->dingo) {/* Take the Modem IO port from the CIS and scan for a free * Ethernet port */ - link->io.NumPorts1 =16 ;/* no Mako stuff anymore */ + link->resource[0 ]->end =16 ;/* no Mako stuff anymore */ if (!pcmcia_loop_config (link, xirc2ps_config_modem,NULL )) goto port_found; }else { - link->io.NumPorts1 =18 ; + link->resource[0 ]->end =18 ;/* We do 2 passes here: The first one uses the regular mapping and * the second tries again, thereby considering that the 32 ports are * mirrored every 32 bytes. Actually we use a mirrored port for
@@ -840,14 +839,15 @@ xirc2ps_config(struct pcmcia_device * link) }printk (KNOT_XIRC "no ports available\n" ); }else { - link->io.NumPorts1 =16 ; + link->io_lines =10 ; + link->resource[0 ]->end =16 ;for (ioaddr =0x300 ; ioaddr <0x400 ; ioaddr +=0x10 ) { - link->io.BasePort1 = ioaddr; -if (!(err=pcmcia_request_io (link, &link->io))) + link->resource[0 ]->start = ioaddr; +if (!(err =pcmcia_request_io (link))) goto port_found; } - link->io.BasePort1 =0 ;/* let CS decide */ -if ((err=pcmcia_request_io (link, &link->io))) + link->resource[0 ]->start =0 ;/* let CS decide */ +if ((err =pcmcia_request_io (link))) goto config_error; } port_found:
drivers/net/wireless/airo_cs.c +10 -12
@@ -175,25 +175,23 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; } }/* This reserves IO space but doesn't actually enable it */ -if (pcmcia_request_io (p_dev, &p_dev->io) !=0 ) +if (pcmcia_request_io (p_dev) !=0 )return -ENODEV ;/*
drivers/net/wireless/atmel_cs.c +10 -12
@@ -190,25 +190,23 @@ static int atmel_config_check(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; } }/* This reserves IO space but doesn't actually enable it */ -return pcmcia_request_io (p_dev, &p_dev->io); +return pcmcia_request_io (p_dev); }static int atmel_config (struct pcmcia_device *link)
drivers/net/wireless/b43/pcmcia.c +0 -4
@@ -77,10 +77,6 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) dev->conf.Attributes =CONF_ENABLE_IRQ ; dev->conf.IntType =INT_MEMORY_AND_IO ; - dev->io.BasePort2 =0 ; - dev->io.NumPorts2 =0 ; - dev->io.Attributes2 =0 ; - win.Attributes =WIN_ADDR_SPACE_MEM |WIN_MEMORY_TYPE_CM |WIN_ENABLE |WIN_DATA_WIDTH_16 |WIN_USE_WAIT ;
drivers/net/wireless/hostap/hostap_cs.c +11 -17
@@ -519,30 +519,24 @@ static int prism2_config_check(struct pcmcia_device *p_dev,PDEBUG (DEBUG_EXTRA ,"IO window settings: cfg->io.nwin=%d " "dflt->io.nwin=%d\n" , cfg->io.nwin, dflt->io.nwin); - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -PDEBUG (DEBUG_EXTRA ,"io->flags = 0x%04X, " -"io.base=0x%04x, len=%d\n" , io->flags, - io->win[0 ].base, io->win[0 ].len); -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = io->flags & -CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; } }/* This reserves IO space but doesn't actually enable it */ -return pcmcia_request_io (p_dev, &p_dev->io); +return pcmcia_request_io (p_dev); }static int prism2_config (struct pcmcia_device *link)
drivers/net/wireless/libertas/if_cs.c +4 -4
@@ -801,9 +801,9 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev,unsigned int vcc, void *priv_data) { - p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; - p_dev->io.BasePort1 = cfg->io.win[0 ].base; - p_dev->io.NumPorts1 = cfg->io.win[0 ].len; + p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; + p_dev->resource[0 ]->start = cfg->io.win[0 ].base; + p_dev->resource[0 ]->end = cfg->io.win[0 ].len;/* Do we need to allocate an interrupt? */ p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;
@@ -815,7 +815,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev, }/* This reserves IO space but doesn't actually enable it */ -return pcmcia_request_io (p_dev, &p_dev->io); +return pcmcia_request_io (p_dev); }static int if_cs_probe (struct pcmcia_device *p_dev)
drivers/net/wireless/orinoco/orinoco_cs.c +11 -13
@@ -191,25 +191,23 @@ static int orinoco_cs_config_check(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; }/* This reserves IO space but doesn't actually enable it */ -if (pcmcia_request_io (p_dev, &p_dev->io) !=0 ) +if (pcmcia_request_io (p_dev) !=0 ) goto next_entry; }return 0 ;
drivers/net/wireless/orinoco/spectrum_cs.c +11 -13
@@ -253,25 +253,23 @@ static int spectrum_cs_config_check(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; }/* This reserves IO space but doesn't actually enable it */ -if (pcmcia_request_io (p_dev, &p_dev->io) !=0 ) +if (pcmcia_request_io (p_dev) !=0 ) goto next_entry; }return 0 ;
drivers/net/wireless/ray_cs.c +2 -3
@@ -315,9 +315,8 @@ static int ray_probe(struct pcmcia_device *p_dev) local->finder = p_dev;/* The io structure describes IO port mapping. None used here */ - p_dev->io.NumPorts1 =0 ; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines =5 ; + p_dev->resource[0 ]->end =0 ; + p_dev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ;/* General socket configuration */ p_dev->conf.Attributes =CONF_ENABLE_IRQ ;
drivers/net/wireless/wl3501_cs.c +6 -6
@@ -1884,9 +1884,8 @@ static int wl3501_probe(struct pcmcia_device *p_dev)struct wl3501_card *this;/* The io structure describes IO port mapping */ - p_dev->io.NumPorts1 =16 ; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines =5 ; + p_dev->resource[0 ]->end =16 ; + p_dev->resource[0 ]->flags =IO_DATA_PATH_WIDTH_8 ;/* General socket configuration */ p_dev->conf.Attributes =CONF_ENABLE_IRQ ;
@@ -1932,13 +1931,14 @@ static int wl3501_config(struct pcmcia_device *link)/* Try allocating IO ports. This tries a few fixed addresses. If you * want, you can also read the card's config table to pick addresses -- * see the serial driver for an example. */ + link->io_lines =5 ;for (j =0x280 ; j <0x400 ; j +=0x20 ) {/* The '^0x300' is so that we probe 0x300-0x3ff first, then * 0x200-0x2ff, and so on, because this seems safer */ - link->io.BasePort1 = j; - link->io.BasePort2 = link->io.BasePort1 +0x10 ; - i =pcmcia_request_io (link, &link->io); + link->resource[0 ]->start = j; + link->resource[1 ]->start = link->resource[0 ]->start +0x10 ; + i =pcmcia_request_io (link);if (i ==0 )break ; }
drivers/parport/parport_cs.c +8 -8
@@ -101,8 +101,8 @@ static int parport_probe(struct pcmcia_device *link) link->priv = info; info->p_dev = link; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - link->io.Attributes2 =IO_DATA_PATH_WIDTH_8 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + link->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_8 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -143,16 +143,16 @@ static int parport_config_check(struct pcmcia_device *p_dev, {if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ;if (epp_mode) p_dev->conf.ConfigIndex |=FORCE_EPP_MODE ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin ==2 ) { - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; } -if (pcmcia_request_io (p_dev, &p_dev->io) !=0 ) +if (pcmcia_request_io (p_dev) !=0 )return -ENODEV ;return 0 ; }
drivers/pcmcia/pcmcia_resource.c +10 -27
@@ -70,7 +70,8 @@ static int alloc_io_space(struct pcmcia_socket *s, struct resource *res, res->flags |=IORESOURCE_IO ; -dev_dbg (&s->dev,"alloc_io_space request for %pR\n" , res); +dev_dbg (&s->dev,"alloc_io_space request for %pR, %d lines\n" , + res, lines); align = base ? (lines ?1 <<lines :0 ) :1 ;if (align && (align < num)) {
@@ -541,38 +542,25 @@ EXPORT_SYMBOL(pcmcia_request_configuration);* pcmcia_request_io() - attempt to reserve port ranges for PCMCIA devices * * pcmcia_request_io() attepts to reserve the IO port ranges specified in -* struct pcmcia_device *p_dev->resource[0] and *p_dev->resource[1]. The +* &struct pcmcia_device @p_dev->resource[0] and @p_dev->resource[1]. The * "start" value is the requested start of the IO port resource; "end" -* relfects the number of ports requested. -* -* If io_req_t is passed, those values are converted automatically. +* reflects the number of ports requested. The number of IO lines requested +* is specified in &struct pcmcia_device @p_dev->io_lines. */ -int pcmcia_request_io (struct pcmcia_device *p_dev,io_req_t *req) +int pcmcia_request_io (struct pcmcia_device *p_dev) {struct pcmcia_socket *s = p_dev->socket; -config_t *c; +config_t *c = p_dev->function_config;int ret = -EINVAL ; -unsigned int lines = req->IOAddrLines;mutex_lock (&s->ops_mutex); +dev_dbg (&s->dev,"pcmcia_request_io: %pR , %pR" , &c->io[0 ], &c->io[1 ]);if (!(s->state &SOCKET_PRESENT )) {dev_dbg (&s->dev,"pcmcia_request_io: No card present\n" ); goto out; } - c = p_dev->function_config; -if (req) { - c->io[0 ].start = req->BasePort1; - c->io[0 ].end = req->NumPorts1; - c->io[0 ].flags |= req->Attributes1; - c->io[1 ].start = req->BasePort2; - c->io[1 ].end = req->NumPorts2; - c->io[1 ].flags |= req->Attributes2; - } - -dev_dbg (&s->dev,"pcmcia_request_io: %pR , %pR" , &c->io[0 ], &c->io[1 ]); -if (c->state &CONFIG_LOCKED ) {dev_dbg (&s->dev,"Configuration is locked\n" ); goto out;
@@ -582,12 +570,12 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req) goto out; } - ret =alloc_io_space (s, &c->io[0 ], lines); + ret =alloc_io_space (s, &c->io[0 ], p_dev->io_lines);if (ret) goto out;if (c->io[1 ].end) { - ret =alloc_io_space (s, &c->io[1 ], lines); + ret =alloc_io_space (s, &c->io[1 ], p_dev->io_lines);if (ret) {release_io_space (s, &c->io[0 ]); goto out;
@@ -598,11 +586,6 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req) c->state |=CONFIG_IO_REQ ; p_dev->_io =1 ; -if (!ret) { - req->BasePort1 = c->io[0 ].start; - req->BasePort2 = c->io[1 ].start; - } -dev_dbg (&s->dev,"pcmcia_request_io succeeded: %pR , %pR" , &c->io[0 ], &c->io[1 ]); out:
drivers/scsi/pcmcia/aha152x_stub.c +7 -7
@@ -100,9 +100,8 @@ static int aha152x_probe(struct pcmcia_device *link) info->p_dev = link; link->priv = info; - link->io.NumPorts1 =0x20 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.IOAddrLines =10 ; + link->resource[0 ]->end =0x20 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ; link->conf.Present =PRESENT_OPTION ;
@@ -130,15 +129,16 @@ static int aha152x_config_check(struct pcmcia_device *p_dev,unsigned int vcc, void *priv_data) { + p_dev->io_lines = 10;/* For New Media T&J, look for a SCSI window */ if (cfg->io.win[0 ].len >=0x20 ) - p_dev->io.BasePort1 = cfg->io.win[0 ].base; + p_dev->resource[0 ]->start = cfg->io.win[0 ].base;else if ((cfg->io.nwin >1 ) && (cfg->io.win[1 ].len >=0x20 )) - p_dev->io.BasePort1 = cfg->io.win[1 ].base; + p_dev->resource[0 ]->start = cfg->io.win[1 ].base;if ((cfg->io.nwin >0 ) && - (p_dev->io.BasePort1 <0xffff )) { -if (!pcmcia_request_io (p_dev, &p_dev->io)) + (p_dev->resource[0 ]->start <0xffff )) { +if (!pcmcia_request_io (p_dev))return 0 ; }return -EINVAL ;
drivers/scsi/pcmcia/fdomain_stub.c +5 -5
@@ -83,9 +83,8 @@ static int fdomain_probe(struct pcmcia_device *link) info->p_dev = link; link->priv = info; - link->io.NumPorts1 =0x10 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.IOAddrLines =10 ; + link->resource[0 ]->end =0x10 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ; link->conf.Present =PRESENT_OPTION ;
@@ -112,8 +111,9 @@ static int fdomain_config_check(struct pcmcia_device *p_dev,unsigned int vcc, void *priv_data) { - p_dev->io.BasePort1 = cfg->io.win[0].base; -return pcmcia_request_io (p_dev, &p_dev->io); + p_dev->io_lines = 10; + p_dev->resource[0 ]->start = cfg->io.win[0 ].base; +return pcmcia_request_io (p_dev); }
drivers/scsi/pcmcia/nsp_cs.c +14 -16
@@ -1558,9 +1558,8 @@ static int nsp_cs_probe(struct pcmcia_device *link)nsp_dbg (NSP_DEBUG_INIT ,"info=0x%p" , info);/* The io structure describes IO port mapping */ - link->io.NumPorts1 =0x10 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.IOAddrLines =10 ;/* not used */ + link->resource[0 ]->end =0x10 ; + link->resource[0 ]->flags =IO_DATA_PATH_WIDTH_AUTO ;/* General socket configuration */ link->conf.Attributes =CONF_ENABLE_IRQ ;
@@ -1641,24 +1640,23 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = + p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; }/* This reserves IO space but doesn't actually enable it */ -if (pcmcia_request_io (p_dev, &p_dev->io) !=0 ) +if (pcmcia_request_io (p_dev) !=0 ) goto next_entry; }
drivers/scsi/pcmcia/qlogic_stub.c +7 -7
@@ -156,9 +156,8 @@ static int qlogic_probe(struct pcmcia_device *link)return -ENOMEM ; info->p_dev = link; link->priv = info; - link->io.NumPorts1 =16 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.IOAddrLines =10 ; + link->resource[0 ]->end =16 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ; link->conf.Present =PRESENT_OPTION ;
@@ -185,13 +184,14 @@ static int qlogic_config_check(struct pcmcia_device *p_dev,unsigned int vcc, void *priv_data) { - p_dev->io.BasePort1 = cfg->io.win[0].base; - p_dev->io.NumPorts1 = cfg->io.win[0 ].len; + p_dev->io_lines = 10; + p_dev->resource[0 ]->start = cfg->io.win[0 ].base; + p_dev->resource[0 ]->end = cfg->io.win[0 ].len; -if (p_dev->io.BasePort1 ==0 ) +if (p_dev->resource[0 ]->start ==0 )return -ENODEV ; -return pcmcia_request_io (p_dev, &p_dev->io); +return pcmcia_request_io (p_dev); }static int qlogic_config (struct pcmcia_device * link)
drivers/scsi/pcmcia/sym53c500_cs.c +7 -7
@@ -690,13 +690,14 @@ static int SYM53C500_config_check(struct pcmcia_device *p_dev,unsigned int vcc, void *priv_data) { - p_dev->io.BasePort1 = cfg->io.win[0].base; - p_dev->io.NumPorts1 = cfg->io.win[0 ].len; + p_dev->io_lines = 10; + p_dev->resource[0 ]->start = cfg->io.win[0 ].base; + p_dev->resource[0 ]->end = cfg->io.win[0 ].len; -if (p_dev->io.BasePort1 ==0 ) +if (p_dev->resource[0 ]->start ==0 )return -ENODEV ; -return pcmcia_request_io (p_dev, &p_dev->io); +return pcmcia_request_io (p_dev); } static int
@@ -858,9 +859,8 @@ SYM53C500_probe(struct pcmcia_device *link)return -ENOMEM ; info->p_dev = link; link->priv = info; - link->io.NumPorts1 =16 ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.IOAddrLines =10 ; + link->resource[0 ]->end =16 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
drivers/serial/serial_cs.c +19 -18
@@ -335,8 +335,8 @@ static int serial_probe(struct pcmcia_device *link) info->p_dev = link; link->priv = info; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - link->io.NumPorts1 =8 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + link->resource[0 ]->end =8 ; link->conf.Attributes =CONF_ENABLE_IRQ ;if (do_sound) { link->conf.Attributes |=CONF_ENABLE_SPKR ;
@@ -424,12 +424,13 @@ static int simple_config_check(struct pcmcia_device *p_dev, p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM ] /10000 ; + p_dev->io_lines = ((*try &0x1 ) ==0 ) ? +16 : cf->io.flags &CISTPL_IO_LINES_MASK ; +if ((cf->io.nwin >0 ) && (cf->io.win[0 ].len == size_table[(*try >>1 )]) && (cf->io.win[0 ].base !=0 )) { - p_dev->io.BasePort1 = cf->io.win[0 ].base; - p_dev->io.IOAddrLines = ((*try &0x1 ) ==0 ) ? -16 : cf->io.flags &CISTPL_IO_LINES_MASK ; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[0 ]->start = cf->io.win[0 ].base; +if (!pcmcia_request_io (p_dev))return 0 ; }return -EINVAL ;
@@ -446,9 +447,9 @@ static int simple_config_check_notpicky(struct pcmcia_device *p_dev,if ((cf->io.nwin >0 ) && ((cf->io.flags &CISTPL_IO_LINES_MASK ) <=3 )) {for (j =0 ; j <5 ; j++) { - p_dev->io.BasePort1 = base[j]; - p_dev->io.IOAddrLines = base[j] ?16 :3 ; -if (!pcmcia_request_io (p_dev, &p_dev->io)) + p_dev->resource[0 ]->start = base[j]; + p_dev->io_lines = base[j] ?16 :3 ; +if (!pcmcia_request_io (p_dev))return 0 ; } }
@@ -521,9 +522,9 @@ static int multi_config_check(struct pcmcia_device *p_dev,/* The quad port cards have bad CIS's, so just look for a window larger than 8 ports and assume it will be right */ if ((cf->io.nwin ==1 ) && (cf->io.win[0 ].len >8 )) { - p_dev->io.BasePort1 = cf->io.win[0 ].base; - p_dev->io.IOAddrLines = cf->io.flags &CISTPL_IO_LINES_MASK ; -if (!pcmcia_request_io (p_dev, &p_dev->io)) { + p_dev->resource[0 ]->start = cf->io.win[0 ].base; + p_dev->io_lines = cf->io.flags &CISTPL_IO_LINES_MASK ; +if (!pcmcia_request_io (p_dev)) { *base2 = p_dev->resource[0 ]->start +8 ;return 0 ; }
@@ -540,10 +541,10 @@ static int multi_config_check_notpicky(struct pcmcia_device *p_dev,int *base2 = priv_data;if (cf->io.nwin ==2 ) { - p_dev->io.BasePort1 = cf->io.win[0 ].base; - p_dev->io.BasePort2 = cf->io.win[1 ].base; - p_dev->io.IOAddrLines = cf->io.flags &CISTPL_IO_LINES_MASK ; -if (!pcmcia_request_io (p_dev, &p_dev->io)) { + p_dev->resource[0 ]->start = cf->io.win[0 ].base; + p_dev->resource[1 ]->start = cf->io.win[1 ].base; + p_dev->io_lines = cf->io.flags &CISTPL_IO_LINES_MASK ; +if (!pcmcia_request_io (p_dev)) { *base2 = p_dev->resource[1 ]->start;return 0 ; }
@@ -557,10 +558,10 @@ static int multi_config(struct pcmcia_device *link)int i, base2 =0 ;/* First, look for a generic full-sized window */ - link->io.NumPorts1 = info->multi *8 ; + link->resource[0 ]->end = info->multi *8 ;if (pcmcia_loop_config (link, multi_config_check, &base2)) {/* If that didn't work, look for two windows */ - link->io.NumPorts1 = link->io.NumPorts2 =8 ; + link->resource[0 ]->end = link->resource[1 ]->end =8 ; info->multi =2 ;if (pcmcia_loop_config (link, multi_config_check_notpicky, &base2)) {
drivers/staging/comedi/drivers/cb_das16_cs.c +11 -13
@@ -736,24 +736,22 @@ static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; }/* This reserves IO space but doesn't actually enable it */ -return pcmcia_request_io (p_dev, &p_dev->io); +return pcmcia_request_io (p_dev); }return 0 ;
drivers/staging/comedi/drivers/das08_cs.c +11 -12
@@ -224,24 +224,23 @@ static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; }/* This reserves IO space but doesn't actually enable it */ -return pcmcia_request_io (p_dev, &p_dev->io); +return pcmcia_request_io (p_dev); }return 0 ; }
drivers/staging/comedi/drivers/ni_daq_700.c +11 -13
@@ -571,24 +571,22 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; }/* This reserves IO space but doesn't actually enable it */ -if (pcmcia_request_io (p_dev, &p_dev->io) !=0 ) +if (pcmcia_request_io (p_dev) !=0 )return -ENODEV ; }
drivers/staging/comedi/drivers/ni_daq_dio24.c +11 -13
@@ -323,24 +323,22 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; }/* This reserves IO space but doesn't actually enable it */ -if (pcmcia_request_io (p_dev, &p_dev->io) !=0 ) +if (pcmcia_request_io (p_dev) !=0 )return -ENODEV ; }
drivers/staging/comedi/drivers/ni_labpc_cs.c +11 -13
@@ -301,24 +301,22 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ |CONF_ENABLE_PULSE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; }/* This reserves IO space but doesn't actually enable it */ -if (pcmcia_request_io (p_dev, &p_dev->io) !=0 ) +if (pcmcia_request_io (p_dev) !=0 )return -ENODEV ; }
drivers/staging/comedi/drivers/ni_mio_cs.c +6 -7
@@ -264,8 +264,8 @@ static const dev_info_t dev_info = "ni_mio_cs";static int cs_attach (struct pcmcia_device *link) { - link->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; - link->io.NumPorts1 =16 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_16 ; + link->resource[0 ]->end =16 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -310,13 +310,12 @@ static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev, {int base, ret; - p_dev->io.NumPorts1 = cfg->io.win[0 ].len; - p_dev->io.IOAddrLines = cfg->io.flags &CISTPL_IO_LINES_MASK ; - p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = cfg->io.win[0 ].len; + p_dev->io_lines = cfg->io.flags &CISTPL_IO_LINES_MASK ;for (base =0x000 ; base <0x400 ; base +=0x20 ) { - p_dev->io.BasePort1 = base; - ret =pcmcia_request_io (p_dev, &p_dev->io); + p_dev->resource[0 ]->start = base; + ret =pcmcia_request_io (p_dev);if (!ret)return 0 ; }
drivers/staging/comedi/drivers/quatech_daqp_cs.c +11 -13
@@ -1102,26 +1102,24 @@ static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; -if (!(io->flags &CISTPL_IO_8BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; -if (!(io->flags &CISTPL_IO_16BIT )) - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; + p_dev->resource[0 ]->flags &= ~IO_DATA_PATH_WIDTH ; + p_dev->resource[0 ]->flags |= +pcmcia_io_cfg_data_width (io->flags); + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len;if (io->nwin >1 ) { - p_dev->io.Attributes2 = p_dev->io.Attributes1; - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->flags = p_dev->resource[0 ]->flags; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; } }/* This reserves IO space but doesn't actually enable it */ -return pcmcia_request_io (p_dev, &p_dev->io); +return pcmcia_request_io (p_dev); }static void daqp_cs_config (struct pcmcia_device *link)
drivers/staging/wlags49_h2/wl_cs.c +4 -4
@@ -145,9 +145,8 @@ static int wl_adapter_attach(struct pcmcia_device *link)return -ENOMEM ; } - link->io.NumPorts1 =HCF_NUM_IO_PORTS ; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_16 ; - link->io.IOAddrLines =6 ; + link->resource[0 ]->end =HCF_NUM_IO_PORTS ; + link->resource[0 ]->flags =IO_DATA_PATH_WIDTH_16 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ; link->conf.ConfigIndex =5 ;
@@ -305,8 +304,9 @@ void wl_adapter_insert( struct pcmcia_device *link )/* Do we need to allocate an interrupt? */ link->conf.Attributes |=CONF_ENABLE_IRQ ; + link->io_lines =6 ; - ret =pcmcia_request_io (link, &link->io); + ret =pcmcia_request_io (link);if (ret !=0 ) goto failed;
drivers/telephony/ixj_pcmcia.c +8 -8
@@ -32,9 +32,8 @@ static int ixj_probe(struct pcmcia_device *p_dev) {dev_dbg (&p_dev->dev,"ixj_attach()\n" );/* Create new ixj device */ - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.Attributes2 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines =3 ; + p_dev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + p_dev->resource[1 ]->flags |=IO_DATA_PATH_WIDTH_8 ; p_dev->conf.IntType =INT_MEMORY_AND_IO ; p_dev->priv =kzalloc (sizeof (struct ixj_info_t ),GFP_KERNEL );if (!p_dev->priv) {
@@ -120,13 +119,14 @@ static int ixj_config_check(struct pcmcia_device *p_dev, {if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len; + p_dev->io_lines =3 ;if (io->nwin ==2 ) { - p_dev->io.BasePort2 = io->win[1 ].base; - p_dev->io.NumPorts2 = io->win[1 ].len; + p_dev->resource[1 ]->start = io->win[1 ].base; + p_dev->resource[1 ]->end = io->win[1 ].len; } -if (!pcmcia_request_io (p_dev, &p_dev->io)) +if (!pcmcia_request_io (p_dev))return 0 ; }return -ENODEV ;
drivers/usb/host/sl811_cs.c +6 -6
@@ -162,16 +162,16 @@ static int sl811_cs_config_check(struct pcmcia_device *p_dev, p_dev->conf.Attributes |=CONF_ENABLE_IRQ ;/* IO window settings */ - p_dev->io.NumPorts1 = p_dev->io.NumPorts2 =0 ; + p_dev->resource[0 ]->end = p_dev->resource[1 ]->end =0 ;if ((cfg->io.nwin >0 ) || (dflt->io.nwin >0 )) {cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; + p_dev->io_lines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.Attributes1 =IO_DATA_PATH_WIDTH_8 ; - p_dev->io.IOAddrLines = io->flags &CISTPL_IO_LINES_MASK ; - p_dev->io.BasePort1 = io->win[0 ].base; - p_dev->io.NumPorts1 = io->win[0 ].len; + p_dev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_8 ; + p_dev->resource[0 ]->start = io->win[0 ].base; + p_dev->resource[0 ]->end = io->win[0 ].len; -return pcmcia_request_io (p_dev, &p_dev->io); +return pcmcia_request_io (p_dev); }pcmcia_disable_device (p_dev);return -ENODEV ;
include/pcmcia/cs.h +0 -17
@@ -56,23 +56,6 @@ typedef struct config_req_t {#define INT_CARDBUS 0x04#define INT_ZOOMED_VIDEO 0x08 -/* For RequestIO and ReleaseIO */ -typedef struct io_req_t { -u_int BasePort1; -u_int NumPorts1; -u_int Attributes1; -u_int BasePort2; -u_int NumPorts2; -u_int Attributes2; -u_int IOAddrLines; -}io_req_t ; - -/* Attributes for RequestIO and ReleaseIO */ -#define IO_DATA_PATH_WIDTH 0x18 -#define IO_DATA_PATH_WIDTH_8 0x00 -#define IO_DATA_PATH_WIDTH_16 0x08 -#define IO_DATA_PATH_WIDTH_AUTO 0x10 -/* Bits in IRQInfo1 field */ #define IRQ_NMI_ID 0x01#define IRQ_IOCK_ID 0x02
include/pcmcia/ds.h +19 -2
@@ -80,7 +80,6 @@ struct pcmcia_device {struct list_head socket_device_list;/* deprecated, will be cleaned up soon */ -io_req_t io;config_req_t conf;window_handle_t win;
@@ -88,6 +87,8 @@ struct pcmcia_device {unsigned int irq;struct resource *resource[MAX_IO_WIN ]; +unsigned int io_lines;/* number of I/O lines */ +/* Is the device suspended? */ u16 suspended:1;
@@ -179,7 +180,7 @@ int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val);int pcmcia_write_config_byte (struct pcmcia_device *p_dev,off_t where,u8 val);/* device configuration */ -int pcmcia_request_io (struct pcmcia_device *p_dev,io_req_t *req); +int pcmcia_request_io (struct pcmcia_device *p_dev); int __must_check __pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
@@ -206,6 +207,22 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,int pcmcia_modify_configuration (struct pcmcia_device *p_dev,modconf_t *mod);void pcmcia_disable_device (struct pcmcia_device *p_dev); +/* IO ports */ +#define IO_DATA_PATH_WIDTH 0x18 +#define IO_DATA_PATH_WIDTH_8 0x00 +#define IO_DATA_PATH_WIDTH_16 0x08 +#define IO_DATA_PATH_WIDTH_AUTO 0x10 + +/* convert flag found in cfgtable to data path width parameter */ +static inline int pcmcia_io_cfg_data_width (unsigned int flags) +{ +if (!(flags &CISTPL_IO_8BIT )) +return IO_DATA_PATH_WIDTH_16 ; +if (!(flags &CISTPL_IO_16BIT )) +return IO_DATA_PATH_WIDTH_8 ; +return IO_DATA_PATH_WIDTH_AUTO ; +} +#endif /* __KERNEL__ */ #endif /* _LINUX_DS_H */
sound/pcmcia/pdaudiocf/pdaudiocf.c +3 -3
@@ -139,8 +139,8 @@ static int snd_pdacf_probe(struct pcmcia_device *link) pdacf->p_dev = link; link->priv = pdacf; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.NumPorts1 =16 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; + link->resource[0 ]->end =16 ; link->conf.Attributes =CONF_ENABLE_IRQ |CONF_ENABLE_PULSE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -219,7 +219,7 @@ static int pdacf_config(struct pcmcia_device *link)snd_printdd (KERN_DEBUG "pdacf_config called\n" ); link->conf.ConfigIndex =0x5 ; - ret =pcmcia_request_io (link, &link->io); + ret =pcmcia_request_io (link);if (ret) goto failed;
sound/pcmcia/vx/vxpocket.c +3 -3
@@ -159,8 +159,8 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl, vxp->p_dev = link; link->priv = chip; - link->io.Attributes1 =IO_DATA_PATH_WIDTH_AUTO ; - link->io.NumPorts1 =16 ; + link->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ; + link->resource[0 ]->end =16 ; link->conf.Attributes =CONF_ENABLE_IRQ ; link->conf.IntType =INT_MEMORY_AND_IO ;
@@ -226,7 +226,7 @@ static int vxpocket_config(struct pcmcia_device *link)strcpy (chip->card->driver, vxp440_hw.name); } - ret =pcmcia_request_io (link, &link->io); + ret =pcmcia_request_io (link);if (ret) goto failed;
Signature · 1 line
1.7.0.4
Dominik Brodowski
maintainerPATCH 7/11 pcmcia: remove memreq_t
In reply to a message not in the archivePage already had to be set to 0; Offset can easily be passed as parameter to pcmcia_map_mem_page.
--- drivers/char/pcmcia/ipwireless/main.c | 14 ++------------ drivers/isdn/hisax/sedlbauer_cs.c | 7 +++---- drivers/mtd/maps/pcmciamtd.c | 13 ++++++------- drivers/net/pcmcia/fmvj18x_cs.c | 10 ++-------- drivers/net/pcmcia/ibmtr_cs.c | 11 +++-------- drivers/net/pcmcia/pcnet_cs.c | 14 ++++---------- drivers/net/pcmcia/smc91c92_cs.c | 9 +++------ drivers/net/pcmcia/xirc2ps_cs.c | 5 +---- drivers/net/wireless/airo_cs.c | 6 ++---- drivers/net/wireless/b43/pcmcia.c | 5 +---- drivers/net/wireless/ray_cs.c | 13 +++---------- drivers/pcmcia/pcmcia_resource.c | 9 +++------ drivers/scsi/pcmcia/nsp_cs.c | 5 ++--- drivers/staging/comedi/drivers/ni_daq_700.c | 6 ++---- drivers/staging/comedi/drivers/ni_daq_dio24.c | 6 ++---- drivers/staging/comedi/drivers/ni_labpc_cs.c | 6 ++---- include/pcmcia/cs.h | 6 ------ include/pcmcia/ds.h | 2 +- 18 files changed, 42 insertions(+), 105 deletions(-)
drivers/char/pcmcia/ipwireless/main.c +2 -12
@@ -84,8 +84,6 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, {struct ipw_dev *ipw = priv_data;struct resource *io_resource; -memreq_t memreq_attr_memory; -memreq_t memreq_common_memory;int ret; p_dev->resource[0 ]->flags |=IO_DATA_PATH_WIDTH_AUTO ;
@@ -121,11 +119,8 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,if (ret !=0 ) goto exit1; - memreq_common_memory.CardOffset = cfg->mem.win[0 ].card_addr; - memreq_common_memory.Page =0 ; - ret =pcmcia_map_mem_page (p_dev, ipw->handle_common_memory, - &memreq_common_memory); + cfg->mem.win[0 ].card_addr);if (ret !=0 ) goto exit2;
@@ -150,12 +145,7 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,if (ret !=0 ) goto exit2; - memreq_attr_memory.CardOffset =0 ; - memreq_attr_memory.Page =0 ; - - ret =pcmcia_map_mem_page (p_dev, ipw->handle_attr_memory, - &memreq_attr_memory); - + ret =pcmcia_map_mem_page (p_dev, ipw->handle_attr_memory,0 );if (ret !=0 ) goto exit3;
drivers/isdn/hisax/sedlbauer_cs.c +3 -4
@@ -232,7 +232,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,*/ if ((cfg->mem.nwin >0 ) || (dflt->mem.nwin >0 )) {cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; -memreq_t map; req->Attributes =WIN_DATA_WIDTH_16 |WIN_MEMORY_TYPE_CM ; req->Attributes |=WIN_ENABLE ; req->Base = mem->win[0 ].host_addr;
@@ -240,9 +239,9 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, req->AccessSpeed =0 ;if (pcmcia_request_window (p_dev, req, &p_dev->win) !=0 )return -ENODEV ; - map.Page =0 ; - map.CardOffset = mem->win[0 ].card_addr; -if (pcmcia_map_mem_page (p_dev, p_dev->win, &map) !=0 ) + +if (pcmcia_map_mem_page (p_dev, p_dev->win, + mem->win[0 ].card_addr) !=0 )return -ENODEV ; }return 0 ;
drivers/mtd/maps/pcmciamtd.c +6 -7
@@ -102,7 +102,7 @@ static caddr_t remap_window(struct map_info *map, unsigned long to) {struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;window_handle_t win = (window_handle_t )map->map_priv_2; -memreq_t mrq; +unsigned int offset;int ret;if (!pcmcia_dev_present (dev->p_dev)) {
@@ -110,15 +110,14 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)return 0 ; } - mrq.CardOffset = to & ~(dev->win_size-1 ); -if (mrq.CardOffset != dev->offset) { + offset = to & ~(dev->win_size-1 ); +if (offset != dev->offset) {DEBUG (2 ,"Remapping window from 0x%8.8x to 0x%8.8x" , - dev->offset, mrq.CardOffset); - mrq.Page =0 ; - ret =pcmcia_map_mem_page (dev->p_dev, win, &mrq); + dev->offset, offset); + ret =pcmcia_map_mem_page (dev->p_dev, win, offset);if (ret !=0 )return NULL ; - dev->offset = mrq.CardOffset; + dev->offset = offset; }return dev->win_base + (to & (dev->win_size-1 )); }
drivers/net/pcmcia/fmvj18x_cs.c +2 -8
@@ -545,7 +545,6 @@ failed:static int fmvj18x_get_hwinfo (struct pcmcia_device *link,u_char *node_id) {win_req_t req; -memreq_t mem;u_char __iomem *base;int i, j;
@@ -558,9 +557,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)return -1 ; base =ioremap (req.Base, req.Size); - mem.Page =0 ; - mem.CardOffset =0 ; -pcmcia_map_mem_page (link, link->win, &mem); +pcmcia_map_mem_page (link, link->win,0 );/* * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format
@@ -594,7 +591,6 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)static int fmvj18x_setup_mfc (struct pcmcia_device *link) {win_req_t req; -memreq_t mem;int i;struct net_device *dev = link->priv;unsigned int ioaddr;
@@ -614,9 +610,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link)return -1 ; } - mem.Page =0 ; - mem.CardOffset =0 ; - i =pcmcia_map_mem_page (link, link->win, &mem); + i =pcmcia_map_mem_page (link, link->win,0 );if (i !=0 ) {iounmap (lp->base); lp->base =NULL ;
drivers/net/pcmcia/ibmtr_cs.c +3 -8
@@ -211,7 +211,6 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)struct net_device *dev = info->dev;struct tok_info *ti =netdev_priv (dev);win_req_t req; -memreq_t mem;int i, ret;dev_dbg (&link->dev,"ibmtr_config\n" );
@@ -250,9 +249,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)if (ret) goto failed; - mem.CardOffset = mmiobase; - mem.Page =0 ; - ret =pcmcia_map_mem_page (link, link->win, &mem); + ret =pcmcia_map_mem_page (link, link->win, mmiobase);if (ret) goto failed; ti->mmio =ioremap (req.Base, req.Size);
@@ -267,13 +264,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)if (ret) goto failed; - mem.CardOffset = srambase; - mem.Page =0 ; - ret =pcmcia_map_mem_page (link, info->sram_win_handle, &mem); + ret =pcmcia_map_mem_page (link, info->sram_win_handle, srambase);if (ret) goto failed; - ti->sram_base = mem.CardOffset >>12 ; + ti->sram_base = srambase >>12 ; ti->sram_virt =ioremap (req.Base, req.Size); ti->sram_phys = req.Base;
drivers/net/pcmcia/pcnet_cs.c +4 -10
@@ -301,7 +301,6 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link) {struct net_device *dev = link->priv;win_req_t req; -memreq_t mem;u_char __iomem *base, *virt;int i, j;
@@ -314,10 +313,8 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)return NULL ; virt =ioremap (req.Base, req.Size); - mem.Page =0 ;for (i =0 ; i <NR_INFO ; i++) { - mem.CardOffset = hw_info[i].offset & ~(req.Size-1 ); -pcmcia_map_mem_page (link, link->win, &mem); +pcmcia_map_mem_page (link, link->win, hw_info[i].offset & ~(req.Size-1 )); base = &virt[hw_info[i].offset & (req.Size-1 )]; if ((readb(base+0) == hw_info[i].a0) && (readb(base+2) == hw_info[i].a1) &&
@@ -1463,7 +1460,6 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,struct net_device *dev = link->priv;pcnet_dev_t *info =PRIV (dev);win_req_t req; -memreq_t mem;int i, window_size, offset, ret; window_size = (stop_pg - start_pg) <<8 ;
@@ -1482,11 +1478,9 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,if (ret) goto failed; - mem.CardOffset = (start_pg <<8 ) + cm_offset; - offset = mem.CardOffset % window_size; - mem.CardOffset -= offset; - mem.Page =0 ; - ret =pcmcia_map_mem_page (link, link->win, &mem); + offset = (start_pg <<8 ) + cm_offset; + offset -= offset % window_size; + ret =pcmcia_map_mem_page (link, link->win, offset);if (ret) goto failed;
drivers/net/pcmcia/smc91c92_cs.c +3 -6
@@ -443,7 +443,7 @@ static int mhz_mfc_config(struct pcmcia_device *link)struct net_device *dev = link->priv;struct smc_private *smc =netdev_priv (dev);win_req_t req; -memreq_t mem; +unsigned int offset;int i; link->conf.Attributes |=CONF_ENABLE_SPKR ;
@@ -467,11 +467,8 @@ static int mhz_mfc_config(struct pcmcia_device *link)return -ENODEV ; smc->base =ioremap (req.Base, req.Size); - mem.CardOffset = mem.Page =0 ; -if (smc->manfid ==MANFID_MOTOROLA ) - mem.CardOffset = link->conf.ConfigBase; - i =pcmcia_map_mem_page (link, link->win, &mem); - + offset = (smc->manfid ==MANFID_MOTOROLA ) ? link->conf.ConfigBase :0 ; + i =pcmcia_map_mem_page (link, link->win, offset);if ((i ==0 ) && (smc->manfid ==MANFID_MEGAHERTZ ) && (smc->cardid ==PRODID_MEGAHERTZ_EM3288 ))
drivers/net/pcmcia/xirc2ps_cs.c +1 -4
@@ -870,7 +870,6 @@ xirc2ps_config(struct pcmcia_device * link)if (local->dingo) {win_req_t req; -memreq_t mem;/* Reset the modem's BAR to the correct value * This is necessary because in the RequestConfiguration call,
@@ -898,9 +897,7 @@ xirc2ps_config(struct pcmcia_device * link) goto config_error; local->dingo_ccr =ioremap (req.Base,0x1000 ) +0x0800 ; - mem.CardOffset =0x0 ; - mem.Page =0 ; -if ((err =pcmcia_map_mem_page (link, link->win, &mem))) +if ((err =pcmcia_map_mem_page (link, link->win,0 ))) goto config_error;/* Setup the CCRs; there are no infos in the CIS about the Ethernet
drivers/net/wireless/airo_cs.c +2 -4
@@ -207,16 +207,14 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,*/ if ((cfg->mem.nwin >0 ) || (dflt->mem.nwin >0 )) {cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; -memreq_t map; req->Attributes =WIN_DATA_WIDTH_16 |WIN_MEMORY_TYPE_CM ; req->Base = mem->win[0 ].host_addr; req->Size = mem->win[0 ].len; req->AccessSpeed =0 ;if (pcmcia_request_window (p_dev, req, &p_dev->win) !=0 )return -ENODEV ; - map.Page =0 ; - map.CardOffset = mem->win[0 ].card_addr; -if (pcmcia_map_mem_page (p_dev, p_dev->win, &map) !=0 ) +if (pcmcia_map_mem_page (p_dev, p_dev->win, + mem->win[0 ].card_addr) !=0 )return -ENODEV ; }/* If we got this far, we're cool! */
drivers/net/wireless/b43/pcmcia.c +1 -4
@@ -64,7 +64,6 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) {struct ssb_bus *ssb;win_req_t win; -memreq_t mem;int err = -ENOMEM ;int res =0 ;
@@ -87,9 +86,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)if (res !=0 ) goto err_kfree_ssb; - mem.CardOffset =0 ; - mem.Page =0 ; - res =pcmcia_map_mem_page (dev, dev->win, &mem); + res =pcmcia_map_mem_page (dev, dev->win,0 );if (res !=0 ) goto err_disable;
drivers/net/wireless/ray_cs.c +3 -10
@@ -393,7 +393,6 @@ static int ray_config(struct pcmcia_device *link)int ret =0 ;int i;win_req_t req; -memreq_t mem;struct net_device *dev = (struct net_device *)link->priv;ray_dev_t *local =netdev_priv (dev);
@@ -430,9 +429,7 @@ static int ray_config(struct pcmcia_device *link) ret =pcmcia_request_window (link, &req, &link->win);if (ret) goto failed; - mem.CardOffset =0x0000 ; - mem.Page =0 ; - ret =pcmcia_map_mem_page (link, link->win, &mem); + ret =pcmcia_map_mem_page (link, link->win,0 );if (ret) goto failed; local->sram =ioremap (req.Base, req.Size);
@@ -446,9 +443,7 @@ static int ray_config(struct pcmcia_device *link) ret =pcmcia_request_window (link, &req, &local->rmem_handle);if (ret) goto failed; - mem.CardOffset =0x8000 ; - mem.Page =0 ; - ret =pcmcia_map_mem_page (link, local->rmem_handle, &mem); + ret =pcmcia_map_mem_page (link, local->rmem_handle,0x8000 );if (ret) goto failed; local->rmem =ioremap (req.Base, req.Size);
@@ -462,9 +457,7 @@ static int ray_config(struct pcmcia_device *link) ret =pcmcia_request_window (link, &req, &local->amem_handle);if (ret) goto failed; - mem.CardOffset =0x0000 ; - mem.Page =0 ; - ret =pcmcia_map_mem_page (link, local->amem_handle, &mem); + ret =pcmcia_map_mem_page (link, local->amem_handle,0 );if (ret) goto failed; local->amem =ioremap (req.Base, req.Size);
drivers/pcmcia/pcmcia_resource.c +3 -6
@@ -193,7 +193,7 @@ EXPORT_SYMBOL(pcmcia_write_config_byte);int pcmcia_map_mem_page (struct pcmcia_device *p_dev,window_handle_t wh, -memreq_t *req) +unsigned int offset) {struct pcmcia_socket *s = p_dev->socket;int ret;
@@ -201,12 +201,9 @@ int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh, wh--;if (wh >=MAX_WIN )return -EINVAL ; -if (req->Page !=0 ) { -dev_dbg (&s->dev,"failure: requested page is zero\n" ); -return -EINVAL ; - } +mutex_lock (&s->ops_mutex); - s->win[wh].card_start = req->CardOffset; + s->win[wh].card_start = offset; ret = s->ops->set_mem_map (s, &s->win[wh]);if (ret)dev_warn (&s->dev,"failed to set_mem_map\n" );
drivers/scsi/pcmcia/nsp_cs.c +2 -3
@@ -1661,7 +1661,6 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, }if ((cfg->mem.nwin >0 ) || (dflt->mem.nwin >0 )) { -memreq_t map;cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; cfg_mem->req.Attributes =WIN_DATA_WIDTH_16 |WIN_MEMORY_TYPE_CM ;
@@ -1673,8 +1672,8 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, cfg_mem->req.AccessSpeed =0 ;if (pcmcia_request_window (p_dev, &cfg_mem->req, &p_dev->win) !=0 ) goto next_entry; - map.Page =0 ; map.CardOffset = mem->win[0 ].card_addr; -if (pcmcia_map_mem_page (p_dev, p_dev->win, &map) !=0 ) +if (pcmcia_map_mem_page (p_dev, p_dev->win, + mem->win[0 ].card_addr) !=0 ) goto next_entry; cfg_mem->data->MmioAddress = (unsigned long )ioremap_nocache (cfg_mem->req.Base, cfg_mem->req.Size);
drivers/staging/comedi/drivers/ni_daq_700.c +2 -4
@@ -556,7 +556,6 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, void *priv_data) {win_req_t *req = priv_data; -memreq_t map;if (cfg->index ==0 )return -ENODEV ;
@@ -602,9 +601,8 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, req->AccessSpeed =0 ;if (pcmcia_request_window (p_dev, req, &p_dev->win))return -ENODEV ; - map.Page =0 ; - map.CardOffset = mem->win[0 ].card_addr; -if (pcmcia_map_mem_page (p_dev, p_dev->win, &map)) +if (pcmcia_map_mem_page (p_dev, p_dev->win, + mem->win[0 ].card_addr))return -ENODEV ; }/* If we got this far, we're cool! */
drivers/staging/comedi/drivers/ni_daq_dio24.c +2 -4
@@ -308,7 +308,6 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, void *priv_data) {win_req_t *req = priv_data; -memreq_t map;if (cfg->index ==0 )return -ENODEV ;
@@ -354,9 +353,8 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, req->AccessSpeed =0 ;if (pcmcia_request_window (p_dev, req, &p_dev->win))return -ENODEV ; - map.Page =0 ; - map.CardOffset = mem->win[0 ].card_addr; -if (pcmcia_map_mem_page (p_dev, p_dev->win, &map)) +if (pcmcia_map_mem_page (p_dev, p_dev->win, + mem->win[0 ].card_addr))return -ENODEV ; }/* If we got this far, we're cool! */
drivers/staging/comedi/drivers/ni_labpc_cs.c +2 -4
@@ -286,7 +286,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, void *priv_data) {win_req_t *req = priv_data; -memreq_t map;if (cfg->index ==0 )return -ENODEV ;
@@ -332,9 +331,8 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, req->AccessSpeed =0 ;if (pcmcia_request_window (p_dev, req, &p_dev->win))return -ENODEV ; - map.Page =0 ; - map.CardOffset = mem->win[0 ].card_addr; -if (pcmcia_map_mem_page (p_dev, p_dev->win, &map)) +if (pcmcia_map_mem_page (p_dev, p_dev->win, + mem->win[0 ].card_addr))return -ENODEV ; }/* If we got this far, we're cool! */
include/pcmcia/cs.h +0 -6
@@ -68,12 +68,6 @@ typedef struct config_req_t {#define PRESENT_IOBASE_3 0x100#define PRESENT_IOSIZE 0x200 -/* For GetMemPage, MapMemPage */ -typedef struct memreq_t { -u_int CardOffset; -u_short Page; -}memreq_t ; -/* For RequestWindow */ typedef struct win_req_t { u_int Attributes;
include/pcmcia/ds.h +1 -1
@@ -202,7 +202,7 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_handle_t *wh);int pcmcia_release_window (struct pcmcia_device *p_dev,window_handle_t win);int pcmcia_map_mem_page (struct pcmcia_device *p_dev,window_handle_t win, -memreq_t *req); +unsigned int offset);int pcmcia_modify_configuration (struct pcmcia_device *p_dev,modconf_t *mod);void pcmcia_disable_device (struct pcmcia_device *p_dev);
Signature · 1 line
1.7.0.4
Dominik Brodowski
maintainerPATCH 11/11 pcmcia: do not request windows if you don't need to
In reply to a message not in the archiveSeveral drivers contained dummy code to request for memory windows, even though they never made use of it. Remove all such code snippets.
--- drivers/isdn/hisax/sedlbauer_cs.c | 37 +------------------------ drivers/net/wireless/airo_cs.c | 37 +------------------------ drivers/staging/comedi/drivers/ni_daq_700.c | 23 +--------------- drivers/staging/comedi/drivers/ni_daq_dio24.c | 24 +--------------- drivers/staging/comedi/drivers/ni_labpc_cs.c | 24 +--------------- 5 files changed, 5 insertions(+), 140 deletions(-)
drivers/isdn/hisax/sedlbauer_cs.c +1 -36
@@ -171,8 +171,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, unsigned int vcc, void *priv_data) { - win_req_t *req = priv_data; -if (cfg->index ==0 )return -ENODEV ;
@@ -219,31 +217,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,return -ENODEV ; } -/* -Now set up a common memory window, if needed. There is room -in the struct pcmcia_device structure for one memory window handle, -but if the base addresses need to be saved, or if multiple -windows are needed, the info should go in the private data -structure for this device. - -Note that the memory window base is a physical address, and -needs to be mapped to virtual space with ioremap() before it -is used. -*/ -if ((cfg->mem.nwin >0 ) || (dflt->mem.nwin >0 )) { -cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; - req->Attributes =WIN_DATA_WIDTH_16 |WIN_MEMORY_TYPE_CM ; - req->Attributes |=WIN_ENABLE ; - req->Base = mem->win[0 ].host_addr; - req->Size = mem->win[0 ].len; - req->AccessSpeed =0 ; -if (pcmcia_request_window (p_dev, req, &p_dev->win) !=0 ) -return -ENODEV ; - -if (pcmcia_map_mem_page (p_dev, p_dev->win, - mem->win[0 ].card_addr) !=0 ) -return -ENODEV ; - }return 0 ; }
@@ -251,16 +224,11 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,static int __devinit sedlbauer_config (struct pcmcia_device *link) { -win_req_t *req;int ret;IsdnCard_t icard;dev_dbg (&link->dev,"sedlbauer_config(0x%p)\n" , link); - req =kzalloc (sizeof (win_req_t),GFP_KERNEL ); -if (!req) -return -ENOMEM ; -/* In this loop, we scan the CIS for configuration table entries, each of which describes a valid card configuration, including
@@ -273,7 +241,7 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link)these things without consulting the CIS, and most client drivers will only use the CIS to fill in implementation-defined details. */ - ret =pcmcia_loop_config (link, sedlbauer_config_check, req); + ret =pcmcia_loop_config (link, sedlbauer_config_check,NULL );if (ret) goto failed;
@@ -297,9 +265,6 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link)printk (" & %pR" , link->resource[0 ]);if (link->resource[1 ])printk (" & %pR" , link->resource[1 ]); -if (link->win) -printk (", mem 0x%06lx-0x%06lx" , req->Base, - req->Base+req->Size-1 );printk ("\n" ); icard.para[0 ] = link->irq;
drivers/net/wireless/airo_cs.c +1 -36
@@ -154,8 +154,6 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, unsigned int vcc, void *priv_data) { - win_req_t *req = priv_data; -if (cfg->index ==0 )return -ENODEV ;
@@ -194,29 +192,6 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,if (pcmcia_request_io (p_dev) !=0 )return -ENODEV ; -/* -Now set up a common memory window, if needed. There is room -in the struct pcmcia_device structure for one memory window handle, -but if the base addresses need to be saved, or if multiple -windows are needed, the info should go in the private data -structure for this device. - -Note that the memory window base is a physical address, and -needs to be mapped to virtual space with ioremap() before it -is used. -*/ -if ((cfg->mem.nwin >0 ) || (dflt->mem.nwin >0 )) { -cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; - req->Attributes =WIN_DATA_WIDTH_16 |WIN_MEMORY_TYPE_CM ; - req->Base = mem->win[0 ].host_addr; - req->Size = mem->win[0 ].len; - req->AccessSpeed =0 ; -if (pcmcia_request_window (p_dev, req, &p_dev->win) !=0 ) -return -ENODEV ; -if (pcmcia_map_mem_page (p_dev, p_dev->win, - mem->win[0 ].card_addr) !=0 ) -return -ENODEV ; - }/* If we got this far, we're cool! */ return 0 ; }
@@ -225,17 +200,12 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,static int airo_config (struct pcmcia_device *link) {local_info_t *dev; -win_req_t *req;int ret; dev = link->priv;dev_dbg (&link->dev,"airo_config\n" ); - req =kzalloc (sizeof (win_req_t),GFP_KERNEL ); -if (!req) -return -ENOMEM ; -/* * In this loop, we scan the CIS for configuration table * entries, each of which describes a valid card
@@ -250,7 +220,7 @@ static int airo_config(struct pcmcia_device *link)* and most client drivers will only use the CIS to fill in * implementation-defined details. */ - ret =pcmcia_loop_config (link, airo_cs_config_check, req); + ret =pcmcia_loop_config (link, airo_cs_config_check,NULL );if (ret) goto failed;
@@ -281,16 +251,11 @@ static int airo_config(struct pcmcia_device *link)printk (" & %pR" , link->resource[0 ]);if (link->resource[1 ])printk (" & %pR" , link->resource[1 ]); -if (link->win) -printk (", mem 0x%06lx-0x%06lx" , req->Base, - req->Base+req->Size-1 );printk ("\n" ); -kfree (req);return 0 ; failed:airo_release (link); -kfree (req);return -ENODEV ; }/* airo_config */
drivers/staging/comedi/drivers/ni_daq_700.c +1 -22
@@ -555,8 +555,6 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, unsigned int vcc, void *priv_data) { - win_req_t *req = priv_data; -if (cfg->index ==0 )return -ENODEV ;
@@ -589,22 +587,6 @@ static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,return -ENODEV ; } -if ((cfg->mem.nwin >0 ) || (dflt->mem.nwin >0 )) { -cistpl_mem_t *mem = - (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; - req->Attributes =WIN_DATA_WIDTH_16 |WIN_MEMORY_TYPE_CM ; - req->Attributes |=WIN_ENABLE ; - req->Base = mem->win[0 ].host_addr; - req->Size = mem->win[0 ].len; -if (req->Size <0x1000 ) - req->Size =0x1000 ; - req->AccessSpeed =0 ; -if (pcmcia_request_window (p_dev, req, &p_dev->win)) -return -ENODEV ; -if (pcmcia_map_mem_page (p_dev, p_dev->win, - mem->win[0 ].card_addr)) -return -ENODEV ; - }/* If we got this far, we're cool! */ return 0 ; }
@@ -618,7 +600,7 @@ static void dio700_config(struct pcmcia_device *link)dev_dbg (&link->dev,"dio700_config\n" ); - ret =pcmcia_loop_config (link, dio700_pcmcia_config_loop, &req); + ret =pcmcia_loop_config (link, dio700_pcmcia_config_loop,NULL );if (ret) {dev_warn (&link->dev,"no configuration found\n" ); goto failed;
@@ -644,9 +626,6 @@ static void dio700_config(struct pcmcia_device *link)printk (", io %pR" , link->resource[0 ]);if (link->resource[1 ])printk (" & %pR" , link->resource[1 ]); -if (link->win) -printk (", mem 0x%06lx-0x%06lx" , req.Base, - req.Base + req.Size -1 );printk ("\n" );return ;
drivers/staging/comedi/drivers/ni_daq_dio24.c +1 -23
@@ -307,8 +307,6 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, unsigned int vcc, void *priv_data) { - win_req_t *req = priv_data; -if (cfg->index ==0 )return -ENODEV ;
@@ -341,22 +339,6 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,return -ENODEV ; } -if ((cfg->mem.nwin >0 ) || (dflt->mem.nwin >0 )) { -cistpl_mem_t *mem = - (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; - req->Attributes =WIN_DATA_WIDTH_16 |WIN_MEMORY_TYPE_CM ; - req->Attributes |=WIN_ENABLE ; - req->Base = mem->win[0 ].host_addr; - req->Size = mem->win[0 ].len; -if (req->Size <0x1000 ) - req->Size =0x1000 ; - req->AccessSpeed =0 ; -if (pcmcia_request_window (p_dev, req, &p_dev->win)) -return -ENODEV ; -if (pcmcia_map_mem_page (p_dev, p_dev->win, - mem->win[0 ].card_addr)) -return -ENODEV ; - }/* If we got this far, we're cool! */ return 0 ; }
@@ -364,13 +346,12 @@ static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,static void dio24_config (struct pcmcia_device *link) {int ret; -win_req_t req;printk (KERN_INFO "ni_daq_dio24: HOLA SOY YO! - config\n" );dev_dbg (&link->dev,"dio24_config\n" ); - ret =pcmcia_loop_config (link, dio24_pcmcia_config_loop, &req); + ret =pcmcia_loop_config (link, dio24_pcmcia_config_loop,NULL );if (ret) {dev_warn (&link->dev,"no configuration found\n" ); goto failed;
@@ -396,9 +377,6 @@ static void dio24_config(struct pcmcia_device *link)printk (" & %pR" , link->resource[0 ]);if (link->resource[1 ])printk (" & %pR" , link->resource[1 ]); -if (link->win) -printk (", mem 0x%06lx-0x%06lx" , req.Base, - req.Base + req.Size -1 );printk ("\n" );return ;
drivers/staging/comedi/drivers/ni_labpc_cs.c +1 -23
@@ -285,8 +285,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, unsigned int vcc, void *priv_data) { - win_req_t *req = priv_data; -if (cfg->index ==0 )return -ENODEV ;
@@ -319,22 +317,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,return -ENODEV ; } -if ((cfg->mem.nwin >0 ) || (dflt->mem.nwin >0 )) { -cistpl_mem_t *mem = - (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; - req->Attributes =WIN_DATA_WIDTH_16 |WIN_MEMORY_TYPE_CM ; - req->Attributes |=WIN_ENABLE ; - req->Base = mem->win[0 ].host_addr; - req->Size = mem->win[0 ].len; -if (req->Size <0x1000 ) - req->Size =0x1000 ; - req->AccessSpeed =0 ; -if (pcmcia_request_window (p_dev, req, &p_dev->win)) -return -ENODEV ; -if (pcmcia_map_mem_page (p_dev, p_dev->win, - mem->win[0 ].card_addr)) -return -ENODEV ; - }/* If we got this far, we're cool! */ return 0 ; }
@@ -343,11 +325,10 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,static void labpc_config (struct pcmcia_device *link) {int ret; -win_req_t req;dev_dbg (&link->dev,"labpc_config\n" ); - ret =pcmcia_loop_config (link, labpc_pcmcia_config_loop, &req); + ret =pcmcia_loop_config (link, labpc_pcmcia_config_loop,NULL );if (ret) {dev_warn (&link->dev,"no configuration found\n" ); goto failed;
@@ -373,9 +354,6 @@ static void labpc_config(struct pcmcia_device *link)printk (" & %pR" , link->resource[0 ]);if (link->resource[1 ])printk (" & %pR" , link->resource[1 ]); -if (link->win) -printk (", mem 0x%06lx-0x%06lx" , req.Base, - req.Base + req.Size -1 );printk ("\n" );return ;
Signature · 1 line
1.7.0.4
Dominik Brodowski
maintainerPATCH 8/11 pcmcia: use struct resource for PCMCIA devices, part 2
In reply to a message not in the archiveUse struct resource * also for iomem resources.
--- drivers/char/pcmcia/ipwireless/main.c | 13 +----- drivers/mtd/maps/pcmciamtd.c | 1 - drivers/net/pcmcia/ibmtr_cs.c | 1 - drivers/net/wireless/b43/pcmcia.c | 3 +- drivers/net/wireless/ray_cs.c | 8 ---- drivers/pcmcia/cs_internal.h | 1 + drivers/pcmcia/ds.c | 7 ++- drivers/pcmcia/pcmcia_resource.c | 70 ++++++++++++++++++--------------- include/pcmcia/cs.h | 35 +++++++---------- include/pcmcia/ds.h | 15 ++++++- 10 files changed, 74 insertions(+), 80 deletions(-)
drivers/char/pcmcia/ipwireless/main.c +2 -11
@@ -157,15 +157,12 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,return 0 ; exit3: -pcmcia_release_window (p_dev, ipw->handle_attr_memory); exit2:if (ipw->common_memory) {release_mem_region (ipw->request_common_memory.Base, ipw->request_common_memory.Size);iounmap (ipw->common_memory); -pcmcia_release_window (p_dev, ipw->handle_common_memory); - }else -pcmcia_release_window (p_dev, ipw->handle_common_memory); + } exit1:release_resource (io_resource);pcmcia_disable_device (p_dev);
@@ -238,13 +235,12 @@ exit:release_mem_region (ipw->request_attr_memory.Base, ipw->request_attr_memory.Size);iounmap (ipw->attr_memory); -pcmcia_release_window (link, ipw->handle_attr_memory); + }if (ipw->common_memory) {release_mem_region (ipw->request_common_memory.Base, ipw->request_common_memory.Size);iounmap (ipw->common_memory); -pcmcia_release_window (link, ipw->handle_common_memory); }pcmcia_disable_device (link);return -1 ;
@@ -262,11 +258,6 @@ static void release_ipwireless(struct ipw_dev *ipw) ipw->request_attr_memory.Size);iounmap (ipw->attr_memory); } -if (ipw->common_memory) -pcmcia_release_window (ipw->link, ipw->handle_common_memory); -if (ipw->attr_memory) -pcmcia_release_window (ipw->link, ipw->handle_attr_memory); -pcmcia_disable_device (ipw->link); }
drivers/mtd/maps/pcmciamtd.c +0 -1
@@ -344,7 +344,6 @@ static void pcmciamtd_release(struct pcmcia_device *link)iounmap (dev->win_base); dev->win_base =NULL ; } -pcmcia_release_window (link, link->win); }pcmcia_disable_device (link); }
drivers/net/pcmcia/ibmtr_cs.c +0 -1
@@ -319,7 +319,6 @@ static void ibmtr_release(struct pcmcia_device *link)if (link->win) {struct tok_info *ti =netdev_priv (dev);iounmap (ti->mmio); -pcmcia_release_window (link, info->sram_win_handle); }pcmcia_disable_device (link); }
drivers/net/wireless/b43/pcmcia.c +1 -2
@@ -76,8 +76,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) dev->conf.Attributes =CONF_ENABLE_IRQ ; dev->conf.IntType =INT_MEMORY_AND_IO ; - win.Attributes =WIN_ADDR_SPACE_MEM |WIN_MEMORY_TYPE_CM | -WIN_ENABLE |WIN_DATA_WIDTH_16 | + win.Attributes =WIN_ENABLE |WIN_DATA_WIDTH_16 |WIN_USE_WAIT ; win.Base =0 ; win.Size =SSB_CORE_SIZE ;
drivers/net/wireless/ray_cs.c +0 -8
@@ -785,7 +785,6 @@ static void ray_release(struct pcmcia_device *link) {struct net_device *dev = link->priv;ray_dev_t *local =netdev_priv (dev); -int i;dev_dbg (&link->dev,"ray_release\n" );
@@ -794,13 +793,6 @@ static void ray_release(struct pcmcia_device *link)iounmap (local->sram);iounmap (local->rmem);iounmap (local->amem); -/* Do bother checking to see if these succeed or not */ - i =pcmcia_release_window (link, local->amem_handle); -if (i !=0 ) -dev_dbg (&link->dev,"ReleaseWindow(local->amem) ret = %x\n" , i); - i =pcmcia_release_window (link, local->rmem_handle); -if (i !=0 ) -dev_dbg (&link->dev,"ReleaseWindow(local->rmem) ret = %x\n" , i);pcmcia_disable_device (link);dev_dbg (&link->dev,"ray_release ending\n" );
drivers/pcmcia/cs_internal.h +1 -0
@@ -40,6 +40,7 @@ typedef struct config_t {unsigned int CardValues;struct resource io[MAX_IO_WIN ];/* io ports */ +struct resource mem[MAX_WIN ];/* mem areas */ struct {u_int Attributes;
drivers/pcmcia/ds.c +5 -2
@@ -552,13 +552,16 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, } p_dev->function_config = c;kref_init (&c->ref); -for (i =0 ; i <MAX_IO_WIN ; i++) { +for (i =0 ; i < (MAX_IO_WIN +MAX_WIN ); i++) { c->io[i].name =dev_name (&p_dev->dev); - c->io[i].flags =IORESOURCE_IO ; + c->io[i].flags = i <MAX_IO_WIN ?IORESOURCE_IO : +IORESOURCE_MEM ; } }for (i =0 ; i <MAX_IO_WIN ; i++) p_dev->resource[i] = &p_dev->function_config->io[i]; +for (; i < (MAX_IO_WIN +MAX_WIN ); i++) + p_dev->resource[i] = &p_dev->function_config->mem[i-MAX_IO_WIN ];mutex_unlock (&s->ops_mutex);
drivers/pcmcia/pcmcia_resource.c +38 -32
166 lines not on this page · raw message
include/pcmcia/cs.h +14 -21
@@ -77,26 +77,19 @@ typedef struct win_req_t { } win_req_t;/* Attributes for RequestWindow */ -#define WIN_ADDR_SPACE 0x0001 -#define WIN_ADDR_SPACE_MEM 0x0000 -#define WIN_ADDR_SPACE_IO 0x0001 -#define WIN_MEMORY_TYPE 0x0002 -#define WIN_MEMORY_TYPE_CM 0x0000 -#define WIN_MEMORY_TYPE_AM 0x0002 -#define WIN_ENABLE 0x0004 -#define WIN_DATA_WIDTH 0x0018 -#define WIN_DATA_WIDTH_8 0x0000 -#define WIN_DATA_WIDTH_16 0x0008 -#define WIN_DATA_WIDTH_32 0x0010 -#define WIN_PAGED 0x0020 -#define WIN_SHARED 0x0040 -#define WIN_FIRST_SHARED 0x0080 -#define WIN_USE_WAIT 0x0100 -#define WIN_STRICT_ALIGN 0x0200 -#define WIN_MAP_BELOW_1MB 0x0400 -#define WIN_PREFETCH 0x0800 -#define WIN_CACHEABLE 0x1000 -#define WIN_BAR_MASK 0xe000 -#define WIN_BAR_SHIFT 13 +#define WIN_MEMORY_TYPE_CM 0x00/* default */ +#define WIN_MEMORY_TYPE_AM 0x20/* MAP_ATTRIB */ +#define WIN_DATA_WIDTH_8 0x00/* default */ +#define WIN_DATA_WIDTH_16 0x02/* MAP_16BIT */ +#define WIN_ENABLE 0x01/* MAP_ACTIVE */ +#define WIN_USE_WAIT 0x40/* MAP_USE_WAIT */ + +#define WIN_FLAGS_MAP 0x63/* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE | +MAP_USE_WAIT */ +#define WIN_FLAGS_REQ 0x1c/* mapping to socket->win[i]: +0x04 -> 0 +0x08 -> 1 +0x0c -> 2 +0x10 -> 3 */ #endif /* _LINUX_CS_H */
include/pcmcia/ds.h +13 -2
@@ -36,7 +36,7 @@ struct pcmcia_device;struct config_t ;struct net_device ; -typedef unsigned long window_handle_t ; +typedef struct resource *window_handle_t ;/* dynamic device IDs for PCMCIA device drivers. See * Documentation/pcmcia/driver.txt for details.
@@ -63,6 +63,17 @@ struct pcmcia_driver {int pcmcia_register_driver (struct pcmcia_driver *driver);void pcmcia_unregister_driver (struct pcmcia_driver *driver); +/* for struct resource * array embedded in struct pcmcia_device */ +enum { +PCMCIA_IOPORT_0 , +PCMCIA_IOPORT_1 , +PCMCIA_IOMEM_0 , +PCMCIA_IOMEM_1 , +PCMCIA_IOMEM_2 , +PCMCIA_IOMEM_3 , +PCMCIA_NUM_RESOURCES , +}; +struct pcmcia_device {/* the socket and the device_no [for multifunction devices] uniquely define a pcmcia_device */
@@ -85,7 +96,7 @@ struct pcmcia_device {/* device setup */ unsigned int irq; -struct resource *resource[MAX_IO_WIN ]; +struct resource *resource[PCMCIA_NUM_RESOURCES ];unsigned int io_lines;/* number of I/O lines */
Signature · 1 line
1.7.0.4
Re: [PATCH 05/11] pcmcia: do not use io_req_t when calling pcmcia_request_io()
In reply to Dominik BrodowskiHi Dominik,
Quoted 6 lines
Instead of
io_req_t, drivers are now requested to fill out structpcmcia_device*p_dev->resource[0,1] for up to two ioport ranges. After a call topcmcia_request_io(), the ports found there are reserved, after callingpcmcia_request_configuration(), they may be used.
Quoted 11 lines
CC Michael Buesch <[email protected]>Signed-off-by Dominik Brodowski <[email protected]>
for the drivers/bluetooth/ pieces.
Regards
Marcel
Marcel Holtmann
Acked-byRe: [PATCH 04/11] pcmcia: do not use io_req_t after call to pcmcia_request_io()
In reply to a message not in the archiveHi Dominik,
Quoted 13 lines
After
pcmcia_request_io(), do not make use of the values stored inio_req_t, but instead use those found in struct pcmcia_device->resource[].CC alsa-devel-K7yf7f+aM1XWsZ/[email protected]Signed-off-by Dominik Brodowski <[email protected]>
for the drivers/bluetooth/ pieces.
Regards
Marcel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
drivers/net/pcmcia/xirc2ps_cs.c xirc2ps_config(struct pcmcia_device * link) · line 886
Quoted 13 lines
drivers/net/pcmcia/xirc2ps_cs.c +1
-0+if (err)goto config_error;drivers/net/pcmcia/xirc2ps_cs.c +3
-4- reg.Action =CS_WRITE ; - reg.Offset =CISREG_IOBASE_1 ; - reg.Value = (link->io.BasePort2 >>8 ) &0xff ; -if ((err =pcmcia_access_configuration_register (link, ®))) + + err =pcmcia_write_config_byte (link,CISREG_IOBASE_1 , + link->io.BasePort2 &0xff );
It should be
err = pcmcia_write_config_byte(link, CISREG_IOBASE_1, (link->io.BasePort2 >> 8) & 0xff);
Dominik Brodowski
maintainerHey,
Quoted 16 lines · Komuro
drivers/net/pcmcia/xirc2ps_cs.c xirc2ps_config(struct pcmcia_device * link) · line 886
Quoted 13 lines
drivers/net/pcmcia/xirc2ps_cs.c +1
-0+if (err)goto config_error;drivers/net/pcmcia/xirc2ps_cs.c +3
-4- reg.Action =CS_WRITE ; - reg.Offset =CISREG_IOBASE_1 ; - reg.Value = (link->io.BasePort2 >>8 ) &0xff ; -if ((err =pcmcia_access_configuration_register (link, ®))) + + err =pcmcia_write_config_byte (link,CISREG_IOBASE_1 , + link->io.BasePort2 &0xff );It should be
Quoted 3 lines
err = pcmcia_write_config_byte(link, CISREG_IOBASE_1, (link->io.BasePort2 >> 8) & 0xff);
Fixed, thanks.
Best,
Dominik