more PCMCIA cleanup patches for 2.6.33
Subsystems (12)
Hej,
In addition to the patches already submitted as RFC on Oct 19th, I'm interested in your input to this patch series. They'll be sent to the PCMCIA list shortly, with CC to other lists if deemed appropriate. If all goes well, I'll ask Linus to pull both patch series once 2.6.32 is released.
pcmcia: use dynamic debug instead of custom infrastructure
pcmcia: use dynamic debug in PCMCIA socket drivers
pcmcia: extend error reporting and debug messages in core
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ide)
pcmcia: deprecate CS_CHECK (bluetooth)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (char)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (isdn)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (net)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ray-cs.c)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (wireless)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (scsi)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (serial_cs)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (sound)
pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
pcmcia: remove now-defunct cs_error, pcmcia_error_{func,ret}
pcmcia: use dev_dbg and dev_print in pd6729.c
Documentation/pcmcia/driver-changes.txt | 5 + drivers/ata/pata_pcmcia.c | 16 +- drivers/bluetooth/bluecard_cs.c | 12 +- drivers/bluetooth/bt3c_cs.c | 9 +- drivers/bluetooth/btuart_cs.c | 9 +- drivers/bluetooth/dtl1_cs.c | 8 +- drivers/char/pcmcia/cm4000_cs.c | 69 ++---- drivers/char/pcmcia/cm4040_cs.c | 42 ++-- drivers/char/pcmcia/ipwireless/main.c | 34 +-- drivers/char/pcmcia/synclink_cs.c | 23 +- drivers/ide/ide-cs.c | 32 +-- drivers/isdn/hardware/avm/avm_cs.c | 2 - drivers/isdn/hisax/avma1_cs.c | 26 +-- drivers/isdn/hisax/elsa_cs.c | 45 +--- drivers/isdn/hisax/sedlbauer_cs.c | 58 ++--- drivers/isdn/hisax/teles_cs.c | 37 +--- drivers/mtd/maps/pcmciamtd.c | 14 +- drivers/net/pcmcia/3c574_cs.c | 66 +++--- drivers/net/pcmcia/3c589_cs.c | 75 ++---- drivers/net/pcmcia/axnet_cs.c | 53 ++--- drivers/net/pcmcia/com20020_cs.c | 55 ++--- drivers/net/pcmcia/fmvj18x_cs.c | 109 +++------ drivers/net/pcmcia/ibmtr_cs.c | 54 ++--- drivers/net/pcmcia/nmclan_cs.c | 148 +++++------- drivers/net/pcmcia/pcnet_cs.c | 67 ++---- drivers/net/pcmcia/smc91c92_cs.c | 85 +++----- drivers/net/pcmcia/xirc2ps_cs.c | 111 ++++------ drivers/net/wireless/airo_cs.c | 48 ++--- drivers/net/wireless/atmel_cs.c | 46 ++--- drivers/net/wireless/hostap/hostap_cs.c | 23 +-- drivers/net/wireless/netwave_cs.c | 88 +++---- drivers/net/wireless/orinoco/orinoco_cs.c | 27 +-- drivers/net/wireless/orinoco/spectrum_cs.c | 54 +++--- drivers/net/wireless/ray_cs.c | 347 ++++++++++++++-------------- drivers/net/wireless/wavelan_cs.c | 24 -- drivers/net/wireless/wl3501_cs.c | 67 ++---- drivers/parport/parport_cs.c | 37 +-- drivers/pcmcia/Kconfig | 36 ++-- drivers/pcmcia/cardbus.c | 4 +- drivers/pcmcia/cistpl.c | 10 +- drivers/pcmcia/cs.c | 60 +++--- drivers/pcmcia/cs_internal.h | 22 -- drivers/pcmcia/ds.c | 188 +++------------ drivers/pcmcia/i82365.c | 37 +-- drivers/pcmcia/m32r_cfc.c | 105 ++++----- drivers/pcmcia/m32r_pcc.c | 51 ++--- drivers/pcmcia/m8xx_pcmcia.c | 40 ++-- drivers/pcmcia/pcmcia_ioctl.c | 31 +-- drivers/pcmcia/pcmcia_resource.c | 126 ++++++----- drivers/pcmcia/pd6729.c | 69 +++--- drivers/pcmcia/pd6729.h | 7 - drivers/pcmcia/tcic.c | 29 +-- drivers/scsi/pcmcia/aha152x_stub.c | 40 ++-- drivers/scsi/pcmcia/fdomain_stub.c | 43 ++--- drivers/scsi/pcmcia/qlogic_stub.c | 44 ++--- drivers/scsi/pcmcia/sym53c500_cs.c | 41 ++--- drivers/serial/serial_cs.c | 53 ++--- drivers/telephony/ixj_pcmcia.c | 36 +-- drivers/usb/host/sl811_cs.c | 46 +--- include/pcmcia/ds.h | 36 --- sound/pcmcia/pdaudiocf/pdaudiocf.c | 21 +- sound/pcmcia/vx/vxpocket.c | 21 +- 62 files changed, 1204 insertions(+), 2017 deletions(-)
Best,
Dominik
PATCH 9/16 pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ray-cs.c)
In reply to a message not in the archiveConvert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of PCMCIA_DEBUG.
Also, remove all usages of the CS_CHECK macro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
--- drivers/net/wireless/ray_cs.c | 347 ++++++++++++++++++++--------------------- 1 files changed, 169 insertions(+), 178 deletions(-)
drivers/net/wireless/ray_cs.c +169 -178
@@ -71,25 +71,7 @@ typedef u_char mac_addr[ETH_ALEN]; /* Hardware address */#include "rayctl.h" #include "ray_cs.h" -/* All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If -you do not define PCMCIA_DEBUG at all, all the debug code will be -left out. If you compile with PCMCIA_DEBUG=0, the debug code will -be present but disabled -- but it can then be enabled for specific -modules at load time with a 'pc_debug=#' option to insmod. -*/ -#ifdef RAYLINK_DEBUG -#define PCMCIA_DEBUG RAYLINK_DEBUG -#endif -#ifdef PCMCIA_DEBUG -static int ray_debug; -static int pc_debug =PCMCIA_DEBUG ; -module_param (pc_debug, int,0 ); -/* #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args); */ -#define DEBUG(n, args...) if (pc_debug > (n)) printk(args); -#else -#define DEBUG(n, args...) -#endif /** Prototypes based on PCMCIA skeleton driver *******************************/ static int ray_config (struct pcmcia_device *link);static void ray_release (struct pcmcia_device *link);
@@ -325,7 +307,7 @@ static int ray_probe(struct pcmcia_device *p_dev)ray_dev_t *local;struct net_device *dev; -DEBUG (1 ,"ray_attach()\n" ); +dev_dbg (&p_dev->dev,"ray_attach()\n" );/* Allocate space for private device-specific data */ dev =alloc_etherdev (sizeof (ray_dev_t));
@@ -357,7 +339,7 @@ static int ray_probe(struct pcmcia_device *p_dev) local->card_status =CARD_INSERTED ; local->authentication_state =UNAUTHENTICATED ; local->num_multi =0 ; -DEBUG (2 ,"ray_attach p_dev = %p, dev = %p, local = %p, intr = %p\n" , +dev_dbg (&p_dev->dev,"ray_attach p_dev = %p, dev = %p, local = %p, intr = %p\n" , p_dev, dev, local, &ray_interrupt);/* Raylink entries in the device structure */
@@ -370,7 +352,7 @@ static int ray_probe(struct pcmcia_device *p_dev)#endif /* WIRELESS_SPY */ -DEBUG (2 ,"ray_cs ray_attach calling ether_setup.)\n" ); +dev_dbg (&p_dev->dev,"ray_cs ray_attach calling ether_setup.)\n" );netif_stop_queue (dev);init_timer (&local->timer);
@@ -393,7 +375,7 @@ static void ray_detach(struct pcmcia_device *link)struct net_device *dev;ray_dev_t *local; -DEBUG (1 ,"ray_detach(0x%p)\n" , link); +dev_dbg (&link->dev,"ray_detach\n" ); this_device =NULL ; dev = link->priv;
@@ -408,7 +390,7 @@ static void ray_detach(struct pcmcia_device *link)unregister_netdev (dev);free_netdev (dev); } -DEBUG (2 ,"ray_cs ray_detach ending\n" ); +dev_dbg (&link->dev,"ray_cs ray_detach ending\n" ); }/* ray_detach */ /*=============================================================================
@@ -416,19 +398,17 @@ static void ray_detach(struct pcmcia_device *link)is received, to configure the PCMCIA socket, and to make the ethernet device available to the system. =============================================================================*/ -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)#define MAX_TUPLE_SIZE 128static int ray_config (struct pcmcia_device *link) { -int last_fn =0 , last_ret =0 ; +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); -DEBUG (1 ,"ray_config(0x%p)\n" , link); +dev_dbg (&link->dev,"ray_config\n" );/* Determine card type and firmware version */ printk(KERN_INFO "ray_cs Detected: %s%s%s%s\n",
@@ -440,14 +420,17 @@ static int ray_config(struct pcmcia_device *link)/* Now allocate an interrupt line. Note that this does not actually assign a handler to the interrupt. */ -CS_CHECK (RequestIRQ,pcmcia_request_irq (link, &link->irq)); + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed; dev->irq = link->irq.AssignedIRQ;/* This actually configures the PCMCIA socket -- setting up the I/O windows and the interrupt mapping. */ -CS_CHECK (RequestConfiguration, -pcmcia_request_configuration (link, &link->conf)); + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) + goto failed;/*** Set up 32k window for shared memory (transmit and control) ************/ req.Attributes =
@@ -455,10 +438,14 @@ static int ray_config(struct pcmcia_device *link) req.Base =0 ; req.Size =0x8000 ; req.AccessSpeed = ray_mem_speed; -CS_CHECK (RequestWindow,pcmcia_request_window (&link, &req, &link->win)); + ret =pcmcia_request_window (&link, &req, &link->win); +if (ret) + goto failed; mem.CardOffset =0x0000 ; mem.Page =0 ; -CS_CHECK (MapMemPage,pcmcia_map_mem_page (link->win, &mem)); + ret =pcmcia_map_mem_page (link->win, &mem); +if (ret) + goto failed; local->sram =ioremap (req.Base, req.Size);/*** Set up 16k window for shared memory (receive buffer) ***************/
@@ -467,11 +454,14 @@ static int ray_config(struct pcmcia_device *link) req.Base =0 ; req.Size =0x4000 ; req.AccessSpeed = ray_mem_speed; -CS_CHECK (RequestWindow, -pcmcia_request_window (&link, &req, &local->rmem_handle)); + ret =pcmcia_request_window (&link, &req, &local->rmem_handle); +if (ret) + goto failed; mem.CardOffset =0x8000 ; mem.Page =0 ; -CS_CHECK (MapMemPage,pcmcia_map_mem_page (local->rmem_handle, &mem)); + ret =pcmcia_map_mem_page (local->rmem_handle, &mem); +if (ret) + goto failed; local->rmem =ioremap (req.Base, req.Size);/*** Set up window for attribute memory ***********************************/
@@ -480,16 +470,19 @@ static int ray_config(struct pcmcia_device *link) req.Base =0 ; req.Size =0x1000 ; req.AccessSpeed = ray_mem_speed; -CS_CHECK (RequestWindow, -pcmcia_request_window (&link, &req, &local->amem_handle)); + ret =pcmcia_request_window (&link, &req, &local->amem_handle); +if (ret) + goto failed; mem.CardOffset =0x0000 ; mem.Page =0 ; -CS_CHECK (MapMemPage,pcmcia_map_mem_page (local->amem_handle, &mem)); + ret =pcmcia_map_mem_page (local->amem_handle, &mem); +if (ret) + goto failed; local->amem =ioremap (req.Base, req.Size); -DEBUG (3 ,"ray_config sram=%p\n" , local->sram); -DEBUG (3 ,"ray_config rmem=%p\n" , local->rmem); -DEBUG (3 ,"ray_config amem=%p\n" , local->amem); +dev_dbg (&link->dev,"ray_config sram=%p\n" , local->sram); +dev_dbg (&link->dev,"ray_config rmem=%p\n" , local->rmem); +dev_dbg (&link->dev,"ray_config amem=%p\n" , local->amem);if (ray_init (dev) <0 ) {ray_release (link);return -ENODEV ;
@@ -511,9 +504,7 @@ static int ray_config(struct pcmcia_device *link)return 0 ; -cs_failed: -cs_error (link, last_fn, last_ret); - +failed:ray_release (link);return -ENODEV ; }/* ray_config */
@@ -543,9 +534,9 @@ static int ray_init(struct net_device *dev)struct ccs __iomem *pccs;ray_dev_t *local =netdev_priv (dev);struct pcmcia_device *link = local->finder; -DEBUG (1 ,"ray_init(0x%p)\n" , dev); +dev_dbg (&link->dev,"ray_init(0x%p)\n" , dev);if (!(pcmcia_dev_present (link))) { -DEBUG (0 ,"ray_init - device not present\n" ); +dev_dbg (&link->dev,"ray_init - device not present\n" );return -1 ; }
@@ -567,13 +558,13 @@ static int ray_init(struct net_device *dev) local->fw_ver = local->startup_res.firmware_version[0 ]; local->fw_bld = local->startup_res.firmware_version[1 ]; local->fw_var = local->startup_res.firmware_version[2 ]; -DEBUG (1 ,"ray_init firmware version %d.%d \n" , local->fw_ver, +dev_dbg (&link->dev,"ray_init firmware version %d.%d \n" , local->fw_ver, local->fw_bld); local->tib_length =0x20 ;if ((local->fw_ver ==5 ) && (local->fw_bld >=30 )) local->tib_length = local->startup_res.tib_length; -DEBUG (2 ,"ray_init tib_length = 0x%02x\n" , local->tib_length); +dev_dbg (&link->dev,"ray_init tib_length = 0x%02x\n" , local->tib_length);/* Initialize CCS's to buffer free state */ pccs =ccs_base (local);for (i =0 ; i <NUMBER_OF_CCS ; i++) {
@@ -592,7 +583,7 @@ static int ray_init(struct net_device *dev)clear_interrupt (local);/* Clear any interrupt from the card */ local->card_status =CARD_AWAITING_PARAM ; -DEBUG (2 ,"ray_init ending\n" ); +dev_dbg (&link->dev,"ray_init ending\n" );return 0 ; }/* ray_init */
@@ -605,9 +596,9 @@ static int dl_startup_params(struct net_device *dev)struct ccs __iomem *pccs;struct pcmcia_device *link = local->finder; -DEBUG (1 ,"dl_startup_params entered\n" ); +dev_dbg (&link->dev,"dl_startup_params entered\n" );if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_cs dl_startup_params - device not present\n" ); +dev_dbg (&link->dev,"ray_cs dl_startup_params - device not present\n" );return -1 ; }
@@ -625,7 +616,7 @@ static int dl_startup_params(struct net_device *dev) local->dl_param_ccs = ccsindex; pccs =ccs_base (local) + ccsindex;writeb (CCS_DOWNLOAD_STARTUP_PARAMS , &pccs->cmd); -DEBUG (2 ,"dl_startup_params start ccsindex = %d\n" , +dev_dbg (&link->dev,"dl_startup_params start ccsindex = %d\n" , local->dl_param_ccs);/* Interrupt the firmware to process the command */ if (interrupt_ecf (local, ccsindex)) {
@@ -641,7 +632,7 @@ static int dl_startup_params(struct net_device *dev) local->timer.data = (long )local; local->timer.function = &verify_dl_startup;add_timer (&local->timer); -DEBUG (2 , +dev_dbg (&link->dev,"ray_cs dl_startup_params started timer for verify_dl_startup\n" );return 0 ; }/* dl_startup_params */
@@ -717,11 +708,11 @@ static void verify_dl_startup(u_long data)struct pcmcia_device *link = local->finder;if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_cs verify_dl_startup - device not present\n" ); +dev_dbg (&link->dev,"ray_cs verify_dl_startup - device not present\n" );return ; } -#ifdef PCMCIA_DEBUG -if (pc_debug >2 ) { +#if 0 + {int i; printk(KERN_DEBUG "verify_dl_startup parameters sent via ccs %d:\n",
@@ -760,7 +751,7 @@ static void start_net(u_long data)int ccsindex;struct pcmcia_device *link = local->finder;if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_cs start_net - device not present\n" ); +dev_dbg (&link->dev,"ray_cs start_net - device not present\n" );return ; }/* Fill in the CCS fields for the ECF */
@@ -771,7 +762,7 @@ static void start_net(u_long data)writeb (0 , &pccs->var.start_network.update_param);/* Interrupt the firmware to process the command */ if (interrupt_ecf (local, ccsindex)) { -DEBUG (1 ,"ray start net failed - card not ready for intr\n" ); +dev_dbg (&link->dev,"ray start net failed - card not ready for intr\n" );writeb (CCS_BUFFER_FREE , &(pccs++)->buffer_status);return ; }
@@ -790,7 +781,7 @@ static void join_net(u_long data)struct pcmcia_device *link = local->finder;if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_cs join_net - device not present\n" ); +dev_dbg (&link->dev,"ray_cs join_net - device not present\n" );return ; }/* Fill in the CCS fields for the ECF */
@@ -802,7 +793,7 @@ static void join_net(u_long data)writeb (0 , &pccs->var.join_network.net_initiated);/* Interrupt the firmware to process the command */ if (interrupt_ecf (local, ccsindex)) { -DEBUG (1 ,"ray join net failed - card not ready for intr\n" ); +dev_dbg (&link->dev,"ray join net failed - card not ready for intr\n" );writeb (CCS_BUFFER_FREE , &(pccs++)->buffer_status);return ; }
@@ -821,7 +812,7 @@ static void ray_release(struct pcmcia_device *link)ray_dev_t *local =netdev_priv (dev);int i; -DEBUG (1 ,"ray_release(0x%p)\n" , link); +dev_dbg (&link->dev,"ray_release\n" );del_timer (&local->timer);
@@ -831,13 +822,13 @@ static void ray_release(struct pcmcia_device *link)/* Do bother checking to see if these succeed or not */ i =pcmcia_release_window (local->amem_handle);if (i !=0 ) -DEBUG (0 ,"ReleaseWindow(local->amem) ret = %x\n" , i); +dev_dbg (&link->dev,"ReleaseWindow(local->amem) ret = %x\n" , i); i =pcmcia_release_window (local->rmem_handle);if (i !=0 ) -DEBUG (0 ,"ReleaseWindow(local->rmem) ret = %x\n" , i); +dev_dbg (&link->dev,"ReleaseWindow(local->rmem) ret = %x\n" , i);pcmcia_disable_device (link); -DEBUG (2 ,"ray_release ending\n" ); +dev_dbg (&link->dev,"ray_release ending\n" ); }static int ray_suspend (struct pcmcia_device *link)
@@ -871,9 +862,9 @@ static int ray_dev_init(struct net_device *dev)ray_dev_t *local =netdev_priv (dev);struct pcmcia_device *link = local->finder; -DEBUG (1 ,"ray_dev_init(dev=%p)\n" , dev); +dev_dbg (&link->dev,"ray_dev_init(dev=%p)\n" , dev);if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_dev_init - device not present\n" ); +dev_dbg (&link->dev,"ray_dev_init - device not present\n" );return -1 ; }#ifdef RAY_IMMEDIATE_INIT
@@ -887,7 +878,7 @@ static int ray_dev_init(struct net_device *dev)/* Postpone the card init so that we can still configure the card, * for example using the Wireless Extensions. The init will happen * in ray_open() - Jean II */ -DEBUG (1 , +dev_dbg (&link->dev,"ray_dev_init: postponing card init to ray_open() ; Status = %d\n" , local->card_status);#endif /* RAY_IMMEDIATE_INIT */
@@ -896,7 +887,7 @@ static int ray_dev_init(struct net_device *dev)memcpy (dev->dev_addr, &local->sparm.b4.a_mac_addr,ADDRLEN );memset (dev->broadcast,0xff ,ETH_ALEN ); -DEBUG (2 ,"ray_dev_init ending\n" ); +dev_dbg (&link->dev,"ray_dev_init ending\n" );return 0 ; }
@@ -906,9 +897,9 @@ static int ray_dev_config(struct net_device *dev, struct ifmap *map)ray_dev_t *local =netdev_priv (dev);struct pcmcia_device *link = local->finder;/* Dummy routine to satisfy device structure */ -DEBUG (1 ,"ray_dev_config(dev=%p,ifmap=%p)\n" , dev, map); +dev_dbg (&link->dev,"ray_dev_config(dev=%p,ifmap=%p)\n" , dev, map);if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_dev_config - device not present\n" ); +dev_dbg (&link->dev,"ray_dev_config - device not present\n" );return -1 ; }
@@ -924,14 +915,14 @@ static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb,short length = skb->len;if (!pcmcia_dev_present (link)) { -DEBUG (2 ,"ray_dev_start_xmit - device not present\n" ); +dev_dbg (&link->dev,"ray_dev_start_xmit - device not present\n" );dev_kfree_skb (skb);return NETDEV_TX_OK ; } -DEBUG (3 ,"ray_dev_start_xmit(skb=%p, dev=%p)\n" , skb, dev); +dev_dbg (&link->dev,"ray_dev_start_xmit(skb=%p, dev=%p)\n" , skb, dev);if (local->authentication_state ==NEED_TO_AUTH ) { -DEBUG (0 ,"ray_cs Sending authentication request.\n" ); +dev_dbg (&link->dev,"ray_cs Sending authentication request.\n" );if (!build_auth_frame (local, local->auth_id,OPEN_AUTH_REQUEST )) { local->authentication_state =AUTHENTICATED ;netif_stop_queue (dev);
@@ -971,7 +962,7 @@ static int ray_hw_xmit(unsigned char *data, int len, struct net_device *dev,struct tx_msg __iomem *ptx;/* Address of xmit buffer in PC space */ short int addr;/* Address of xmit buffer in card space */ -DEBUG (3 ,"ray_hw_xmit(data=%p, len=%d, dev=%p)\n" , data, len, dev); +pr_debug ("ray_hw_xmit(data=%p, len=%d, dev=%p)\n" , data, len, dev);if (len +TX_HEADER_LENGTH >TX_BUF_SIZE ) {printk (KERN_INFO "ray_hw_xmit packet too large: %d bytes\n" , len);
@@ -979,9 +970,9 @@ static int ray_hw_xmit(unsigned char *data, int len, struct net_device *dev, }switch (ccsindex =get_free_tx_ccs (local)) {case ECCSBUSY : -DEBUG (2 ,"ray_hw_xmit tx_ccs table busy\n" ); +pr_debug ("ray_hw_xmit tx_ccs table busy\n" );case ECCSFULL : -DEBUG (2 ,"ray_hw_xmit No free tx ccs\n" ); +pr_debug ("ray_hw_xmit No free tx ccs\n" );case ECARDGONE :netif_stop_queue (dev);return XMIT_NO_CCS ;
@@ -1018,12 +1009,12 @@ static int ray_hw_xmit(unsigned char *data, int len, struct net_device *dev,writeb (PSM_CAM , &pccs->var.tx_request.pow_sav_mode);writeb (local->net_default_tx_rate, &pccs->var.tx_request.tx_rate);writeb (0 , &pccs->var.tx_request.antenna); -DEBUG (3 ,"ray_hw_xmit default_tx_rate = 0x%x\n" , +pr_debug ("ray_hw_xmit default_tx_rate = 0x%x\n" , local->net_default_tx_rate);/* Interrupt the firmware to process the command */ if (interrupt_ecf (local, ccsindex)) { -DEBUG (2 ,"ray_hw_xmit failed - ECF not ready for intr\n" ); +pr_debug ("ray_hw_xmit failed - ECF not ready for intr\n" );/* TBD very inefficient to copy packet to buffer, and then not send it, but the alternative is to queue the messages and that won't be done for a while. Maybe set tbusy until a CCS is free?
@@ -1040,7 +1031,7 @@ static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx, {__be16 proto = ((struct ethhdr *)data)->h_proto;if (ntohs (proto) >=1536 ) {/* DIX II ethernet frame */ -DEBUG (3 ,"ray_cs translate_frame DIX II\n" ); +pr_debug ("ray_cs translate_frame DIX II\n" );/* Copy LLC header to card buffer */ memcpy_toio (&ptx->var, eth2_llc,sizeof (eth2_llc)); memcpy_toio(((void __iomem *)&ptx->var) + sizeof(eth2_llc),
@@ -1056,9 +1047,9 @@ static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx, len - ETH_HLEN);return (int )sizeof (struct snaphdr_t ) -ETH_HLEN ; }else {/* already 802 type, and proto is length */ -DEBUG (3 ,"ray_cs translate_frame 802\n" ); +pr_debug ("ray_cs translate_frame 802\n" );if (proto ==htons (0xffff )) {/* evil netware IPX 802.3 without LLC */ -DEBUG (3 ,"ray_cs translate_frame evil IPX\n" ); +pr_debug ("ray_cs translate_frame evil IPX\n" );memcpy_toio (&ptx->var, data +ETH_HLEN , len -ETH_HLEN );return 0 -ETH_HLEN ; }
@@ -1603,7 +1594,7 @@ static int ray_open(struct net_device *dev)struct pcmcia_device *link; link = local->finder; -DEBUG (1 ,"ray_open('%s')\n" , dev->name); +dev_dbg (&link->dev,"ray_open('%s')\n" , dev->name);if (link->open ==0 ) local->num_multi =0 ;
@@ -1613,7 +1604,7 @@ static int ray_open(struct net_device *dev)if (local->card_status ==CARD_AWAITING_PARAM ) {int i; -DEBUG (1 ,"ray_open: doing init now !\n" ); +dev_dbg (&link->dev,"ray_open: doing init now !\n" );/* Download startup parameters */ if ((i =dl_startup_params (dev)) <0 ) {
@@ -1629,7 +1620,7 @@ static int ray_open(struct net_device *dev)else netif_start_queue (dev); -DEBUG (2 ,"ray_open ending\n" ); +dev_dbg (&link->dev,"ray_open ending\n" );return 0 ; }/* end ray_open */
@@ -1640,7 +1631,7 @@ static int ray_dev_close(struct net_device *dev)struct pcmcia_device *link; link = local->finder; -DEBUG (1 ,"ray_dev_close('%s')\n" , dev->name); +dev_dbg (&link->dev,"ray_dev_close('%s')\n" , dev->name); link->open--;netif_stop_queue (dev);
@@ -1656,7 +1647,7 @@ static int ray_dev_close(struct net_device *dev)/*===========================================================================*/ static void ray_reset (struct net_device *dev) { -DEBUG (1 ,"ray_reset entered\n" ); +pr_debug ("ray_reset entered\n" );return ; }
@@ -1669,17 +1660,17 @@ static int interrupt_ecf(ray_dev_t *local, int ccs)struct pcmcia_device *link = local->finder;if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_cs interrupt_ecf - device not present\n" ); +dev_dbg (&link->dev,"ray_cs interrupt_ecf - device not present\n" );return -1 ; } -DEBUG (2 ,"interrupt_ecf(local=%p, ccs = 0x%x\n" , local, ccs); +dev_dbg (&link->dev,"interrupt_ecf(local=%p, ccs = 0x%x\n" , local, ccs);while (i && (readb (local->amem +CIS_OFFSET +ECF_INTR_OFFSET ) &ECF_INTR_SET )) i--;if (i ==0 ) { -DEBUG (2 ,"ray_cs interrupt_ecf card not ready for interrupt\n" ); +dev_dbg (&link->dev,"ray_cs interrupt_ecf card not ready for interrupt\n" );return -1 ; }/* Fill the mailbox, then kick the card */
@@ -1698,12 +1689,12 @@ static int get_free_tx_ccs(ray_dev_t *local)struct pcmcia_device *link = local->finder;if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_cs get_free_tx_ccs - device not present\n" ); +dev_dbg (&link->dev,"ray_cs get_free_tx_ccs - device not present\n" );return ECARDGONE ; }if (test_and_set_bit (0 , &local->tx_ccs_lock)) { -DEBUG (1 ,"ray_cs tx_ccs_lock busy\n" ); +dev_dbg (&link->dev,"ray_cs tx_ccs_lock busy\n" );return ECCSBUSY ; }
@@ -1716,7 +1707,7 @@ static int get_free_tx_ccs(ray_dev_t *local) } } local->tx_ccs_lock =0 ; -DEBUG (2 ,"ray_cs ERROR no free tx CCS for raylink card\n" ); +dev_dbg (&link->dev,"ray_cs ERROR no free tx CCS for raylink card\n" );return ECCSFULL ; }/* get_free_tx_ccs */
@@ -1730,11 +1721,11 @@ static int get_free_ccs(ray_dev_t *local)struct pcmcia_device *link = local->finder;if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_cs get_free_ccs - device not present\n" ); +dev_dbg (&link->dev,"ray_cs get_free_ccs - device not present\n" );return ECARDGONE ; }if (test_and_set_bit (0 , &local->ccs_lock)) { -DEBUG (1 ,"ray_cs ccs_lock busy\n" ); +dev_dbg (&link->dev,"ray_cs ccs_lock busy\n" );return ECCSBUSY ; }
@@ -1747,7 +1738,7 @@ static int get_free_ccs(ray_dev_t *local) } } local->ccs_lock =0 ; -DEBUG (1 ,"ray_cs ERROR no free CCS for raylink card\n" ); +dev_dbg (&link->dev,"ray_cs ERROR no free CCS for raylink card\n" );return ECCSFULL ; }/* get_free_ccs */
@@ -1823,7 +1814,7 @@ static struct net_device_stats *ray_get_stats(struct net_device *dev)struct pcmcia_device *link = local->finder;struct status __iomem *p = local->sram +STATUS_BASE ;if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_cs net_device_stats - device not present\n" ); +dev_dbg (&link->dev,"ray_cs net_device_stats - device not present\n" );return &local->stats; }if (readb (&p->mrx_overflow_for_host)) {
@@ -1856,12 +1847,12 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value,struct ccs __iomem *pccs;if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_update_parm - device not present\n" ); +dev_dbg (&link->dev,"ray_update_parm - device not present\n" );return ; }if ((ccsindex =get_free_ccs (local)) <0 ) { -DEBUG (0 ,"ray_update_parm - No free ccs\n" ); +dev_dbg (&link->dev,"ray_update_parm - No free ccs\n" );return ; } pccs =ccs_base (local) + ccsindex;
@@ -1874,7 +1865,7 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value, }/* Interrupt the firmware to process the command */ if (interrupt_ecf (local, ccsindex)) { -DEBUG (0 ,"ray_cs associate failed - ECF not ready for intr\n" ); +dev_dbg (&link->dev,"ray_cs associate failed - ECF not ready for intr\n" );writeb (CCS_BUFFER_FREE , &(pccs++)->buffer_status); } }
@@ -1891,12 +1882,12 @@ static void ray_update_multi_list(struct net_device *dev, int all)void __iomem *p = local->sram +HOST_TO_ECF_BASE ;if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_update_multi_list - device not present\n" ); +dev_dbg (&link->dev,"ray_update_multi_list - device not present\n" );return ; }else -DEBUG (2 ,"ray_update_multi_list(%p)\n" , dev); +dev_dbg (&link->dev,"ray_update_multi_list(%p)\n" , dev);if ((ccsindex =get_free_ccs (local)) <0 ) { -DEBUG (1 ,"ray_update_multi - No free ccs\n" ); +dev_dbg (&link->dev,"ray_update_multi - No free ccs\n" );return ; } pccs =ccs_base (local) + ccsindex;
@@ -1910,7 +1901,7 @@ static void ray_update_multi_list(struct net_device *dev, int all)for (dmip = &dev->mc_list; (dmi = *dmip) !=NULL ; dmip = &dmi->next) {memcpy_toio (p, dmi->dmi_addr,ETH_ALEN ); - DEBUG(1, + dev_dbg(&link->dev, "ray_update_multi add addr %02x%02x%02x%02x%02x%02x\n", dmi->dmi_addr[0], dmi->dmi_addr[1], dmi->dmi_addr[2], dmi->dmi_addr[3],
@@ -1921,12 +1912,12 @@ static void ray_update_multi_list(struct net_device *dev, int all)if (i >256 /ADDRLEN ) i =256 /ADDRLEN ;writeb ((UCHAR ) i, &pccs->var); -DEBUG (1 ,"ray_cs update_multi %d addresses in list\n" , i); +dev_dbg (&link->dev,"ray_cs update_multi %d addresses in list\n" , i);/* Interrupt the firmware to process the command */ local->num_multi = i; }if (interrupt_ecf (local, ccsindex)) { -DEBUG (1 , +dev_dbg (&link->dev,"ray_cs update_multi failed - ECF not ready for intr\n" );writeb (CCS_BUFFER_FREE , &(pccs++)->buffer_status); }
@@ -1938,11 +1929,11 @@ static void set_multicast_list(struct net_device *dev)ray_dev_t *local =netdev_priv (dev);UCHAR promisc; -DEBUG (2 ,"ray_cs set_multicast_list(%p)\n" , dev); +pr_debug ("ray_cs set_multicast_list(%p)\n" , dev);if (dev->flags &IFF_PROMISC ) {if (local->sparm.b5.a_promiscuous_mode ==0 ) { -DEBUG (1 ,"ray_cs set_multicast_list promisc on\n" ); +pr_debug ("ray_cs set_multicast_list promisc on\n" ); local->sparm.b5.a_promiscuous_mode =1 ; promisc =1 ; ray_update_parm(dev, OBJID_promiscuous_mode,
@@ -1950,7 +1941,7 @@ static void set_multicast_list(struct net_device *dev) } }else {if (local->sparm.b5.a_promiscuous_mode ==1 ) { -DEBUG (1 ,"ray_cs set_multicast_list promisc off\n" ); +pr_debug ("ray_cs set_multicast_list promisc off\n" ); local->sparm.b5.a_promiscuous_mode =0 ; promisc =0 ; ray_update_parm(dev, OBJID_promiscuous_mode,
@@ -1984,19 +1975,19 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)if (dev ==NULL )/* Note that we want interrupts with dev->start == 0 */ return IRQ_NONE ; -DEBUG (4 ,"ray_cs: interrupt for *dev=%p\n" , dev); +pr_debug ("ray_cs: interrupt for *dev=%p\n" , dev); local =netdev_priv (dev); link = (struct pcmcia_device *)local->finder;if (!pcmcia_dev_present (link)) { -DEBUG (2 , -"ray_cs interrupt from device not present or suspended.\n" ); +pr_debug ( +"ray_cs interrupt from device not present or suspended.\n" );return IRQ_NONE ; } rcsindex =readb (&((struct scb __iomem *)(local->sram))->rcs_index);if (rcsindex >= (NUMBER_OF_CCS +NUMBER_OF_RCS )) { -DEBUG (1 ,"ray_cs interrupt bad rcsindex = 0x%x\n" , rcsindex); +dev_dbg (&link->dev,"ray_cs interrupt bad rcsindex = 0x%x\n" , rcsindex);clear_interrupt (local);return IRQ_HANDLED ; }
@@ -2008,33 +1999,33 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)case CCS_DOWNLOAD_STARTUP_PARAMS :/* Happens in firmware someday */ del_timer (&local->timer);if (status ==CCS_COMMAND_COMPLETE ) { -DEBUG (1 , +dev_dbg (&link->dev,"ray_cs interrupt download_startup_parameters OK\n" ); }else { -DEBUG (1 , +dev_dbg (&link->dev,"ray_cs interrupt download_startup_parameters fail\n" ); }break ;case CCS_UPDATE_PARAMS : -DEBUG (1 ,"ray_cs interrupt update params done\n" ); +dev_dbg (&link->dev,"ray_cs interrupt update params done\n" );if (status !=CCS_COMMAND_COMPLETE ) { tmp =readb (&pccs->var.update_param. failure_cause); -DEBUG (0 , +dev_dbg (&link->dev,"ray_cs interrupt update params failed - reason %d\n" , tmp); }break ;case CCS_REPORT_PARAMS : -DEBUG (1 ,"ray_cs interrupt report params done\n" ); +dev_dbg (&link->dev,"ray_cs interrupt report params done\n" );break ;case CCS_UPDATE_MULTICAST_LIST :/* Note that this CCS isn't returned */ -DEBUG (1 , +dev_dbg (&link->dev,"ray_cs interrupt CCS Update Multicast List done\n" );break ;case CCS_UPDATE_POWER_SAVINGS_MODE : -DEBUG (1 , +dev_dbg (&link->dev,"ray_cs interrupt update power save mode done\n" );break ;case CCS_START_NETWORK :
@@ -2043,11 +2034,11 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)if (readb (&pccs->var.start_network.net_initiated) ==1 ) { -DEBUG (0 , +dev_dbg (&link->dev,"ray_cs interrupt network \"%s\" started\n" , local->sparm.b4.a_current_ess_id); }else { -DEBUG (0 , +dev_dbg (&link->dev,"ray_cs interrupt network \"%s\" joined\n" , local->sparm.b4.a_current_ess_id); }
@@ -2075,12 +2066,12 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id) local->timer.expires = jiffies +HZ *5 ; local->timer.data = (long )local;if (status ==CCS_START_NETWORK ) { -DEBUG (0 , +dev_dbg (&link->dev,"ray_cs interrupt network \"%s\" start failed\n" , local->sparm.b4.a_current_ess_id); local->timer.function = &start_net; }else { -DEBUG (0 , +dev_dbg (&link->dev,"ray_cs interrupt network \"%s\" join failed\n" , local->sparm.b4.a_current_ess_id); local->timer.function = &join_net;
@@ -2091,19 +2082,19 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)case CCS_START_ASSOCIATION :if (status ==CCS_COMMAND_COMPLETE ) { local->card_status =CARD_ASSOC_COMPLETE ; -DEBUG (0 ,"ray_cs association successful\n" ); +dev_dbg (&link->dev,"ray_cs association successful\n" ); }else { -DEBUG (0 ,"ray_cs association failed,\n" ); +dev_dbg (&link->dev,"ray_cs association failed,\n" ); local->card_status =CARD_ASSOC_FAILED ;join_net ((u_long ) local); }break ;case CCS_TX_REQUEST :if (status ==CCS_COMMAND_COMPLETE ) { -DEBUG (3 , +dev_dbg (&link->dev,"ray_cs interrupt tx request complete\n" ); }else { -DEBUG (1 , +dev_dbg (&link->dev,"ray_cs interrupt tx request failed\n" ); }if (!sniffer)
@@ -2111,21 +2102,21 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)netif_wake_queue (dev);break ;case CCS_TEST_MEMORY : -DEBUG (1 ,"ray_cs interrupt mem test done\n" ); +dev_dbg (&link->dev,"ray_cs interrupt mem test done\n" );break ;case CCS_SHUTDOWN : -DEBUG (1 , +dev_dbg (&link->dev,"ray_cs interrupt Unexpected CCS returned - Shutdown\n" );break ;case CCS_DUMP_MEMORY : -DEBUG (1 ,"ray_cs interrupt dump memory done\n" ); +dev_dbg (&link->dev,"ray_cs interrupt dump memory done\n" );break ;case CCS_START_TIMER : -DEBUG (2 , +dev_dbg (&link->dev,"ray_cs interrupt DING - raylink timer expired\n" );break ;default : -DEBUG (1 , +dev_dbg (&link->dev,"ray_cs interrupt Unexpected CCS 0x%x returned 0x%x\n" , rcsindex, cmd); }
@@ -2139,7 +2130,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)ray_rx (dev, local, prcs);break ;case REJOIN_NET_COMPLETE : -DEBUG (1 ,"ray_cs interrupt rejoin net complete\n" ); +dev_dbg (&link->dev,"ray_cs interrupt rejoin net complete\n" ); local->card_status =CARD_ACQ_COMPLETE ;/* do we need to clear tx buffers CCS's? */ if (local->sparm.b4.a_network_type ==ADHOC ) {
@@ -2149,7 +2140,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)memcpy_fromio (&local->bss_id, prcs->var.rejoin_net_complete. bssid,ADDRLEN ); - DEBUG(1, + dev_dbg(&link->dev, "ray_cs new BSSID = %02x%02x%02x%02x%02x%02x\n", local->bss_id[0], local->bss_id[1], local->bss_id[2], local->bss_id[3],
@@ -2159,15 +2150,15 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id) }break ;case ROAMING_INITIATED : -DEBUG (1 ,"ray_cs interrupt roaming initiated\n" ); +dev_dbg (&link->dev,"ray_cs interrupt roaming initiated\n" );netif_stop_queue (dev); local->card_status =CARD_DOING_ACQ ;break ;case JAPAN_CALL_SIGN_RXD : -DEBUG (1 ,"ray_cs interrupt japan call sign rx\n" ); +dev_dbg (&link->dev,"ray_cs interrupt japan call sign rx\n" );break ;default : -DEBUG (1 , +dev_dbg (&link->dev,"ray_cs Unexpected interrupt for RCS 0x%x cmd = 0x%x\n" , rcsindex, (unsigned int )readb (&prcs->interrupt_id));
@@ -2186,7 +2177,7 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local,int rx_len;unsigned int pkt_addr;void __iomem *pmsg; -DEBUG (4 ,"ray_rx process rx packet\n" ); +pr_debug ("ray_rx process rx packet\n" );/* Calculate address of packet within Rx buffer */ pkt_addr = ((readb(&prcs->var.rx_packet.rx_data_ptr[0]) << 8)
@@ -2199,28 +2190,28 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local, pmsg = local->rmem + pkt_addr;switch (readb (pmsg)) {case DATA_TYPE : -DEBUG (4 ,"ray_rx data type\n" ); +pr_debug ("ray_rx data type\n" );rx_data (dev, prcs, pkt_addr, rx_len);break ;case AUTHENTIC_TYPE : -DEBUG (4 ,"ray_rx authentic type\n" ); +pr_debug ("ray_rx authentic type\n" );if (sniffer)rx_data (dev, prcs, pkt_addr, rx_len);else rx_authenticate (local, prcs, pkt_addr, rx_len);break ;case DEAUTHENTIC_TYPE : -DEBUG (4 ,"ray_rx deauth type\n" ); +pr_debug ("ray_rx deauth type\n" );if (sniffer)rx_data (dev, prcs, pkt_addr, rx_len);else rx_deauthenticate (local, prcs, pkt_addr, rx_len);break ;case NULL_MSG_TYPE : -DEBUG (3 ,"ray_cs rx NULL msg\n" ); +pr_debug ("ray_cs rx NULL msg\n" );break ;case BEACON_TYPE : -DEBUG (4 ,"ray_rx beacon type\n" ); +pr_debug ("ray_rx beacon type\n" );if (sniffer)rx_data (dev, prcs, pkt_addr, rx_len);
@@ -2233,7 +2224,7 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local,ray_get_stats (dev);break ;default : -DEBUG (0 ,"ray_cs unknown pkt type %2x\n" , +pr_debug ("ray_cs unknown pkt type %2x\n" , (unsigned int )readb (pmsg));break ; }
@@ -2262,7 +2253,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, rx_len > (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + FCS_LEN)) { -DEBUG (0 , +pr_debug ("ray_cs invalid packet length %d received \n" , rx_len);return ;
@@ -2273,17 +2264,17 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, rx_len > (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + FCS_LEN)) { -DEBUG (0 , +pr_debug ("ray_cs invalid packet length %d received \n" , rx_len);return ; } } } -DEBUG (4 ,"ray_cs rx_data packet\n" ); +pr_debug ("ray_cs rx_data packet\n" );/* If fragmented packet, verify sizes of fragments add up */ if (readb (&prcs->var.rx_packet.next_frag_rcs_index) !=0xFF ) { -DEBUG (1 ,"ray_cs rx'ed fragment\n" ); +pr_debug ("ray_cs rx'ed fragment\n" ); tmp = (readb (&prcs->var.rx_packet.totalpacketlength[0 ]) <<8 ) +readb (&prcs->var.rx_packet.totalpacketlength[1 ]); total_len = tmp;
@@ -2301,7 +2292,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, }while (1 );if (tmp <0 ) { -DEBUG (0 , +pr_debug ("ray_cs rx_data fragment lengths don't add up\n" ); local->stats.rx_dropped++;release_frag_chain (local, prcs);
@@ -2313,7 +2304,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, skb =dev_alloc_skb (total_len +5 );if (skb ==NULL ) { -DEBUG (0 ,"ray_cs rx_data could not allocate skb\n" ); +pr_debug ("ray_cs rx_data could not allocate skb\n" ); local->stats.rx_dropped++;if (readb (&prcs->var.rx_packet.next_frag_rcs_index) !=0xFF )release_frag_chain (local, prcs);
@@ -2321,7 +2312,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, }skb_reserve (skb,2 );/* Align IP on 16 byte (TBD check this) */ -DEBUG (4 ,"ray_cs rx_data total_len = %x, rx_len = %x\n" , total_len, +pr_debug ("ray_cs rx_data total_len = %x, rx_len = %x\n" , total_len, rx_len);/************************/
@@ -2354,7 +2345,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs, tmp =17 ;if (readb (&prcs->var.rx_packet.next_frag_rcs_index) !=0xFF ) { prcslink = prcs; -DEBUG (1 ,"ray_cs rx_data in fragment loop\n" ); +pr_debug ("ray_cs rx_data in fragment loop\n" ); do { prcslink = rcs_base(local) +
@@ -2426,8 +2417,8 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)memcpy (destaddr,ieee80211_get_DA (pmac),ADDRLEN );memcpy (srcaddr,ieee80211_get_SA (pmac),ADDRLEN ); -#ifdef PCMCIA_DEBUG -if (pc_debug >3 ) { +#if 0 + if {print_hex_dump (KERN_DEBUG ,"skb->data before untranslate: " ,DUMP_PREFIX_NONE ,16 ,1 , skb->data,64 , true);
@@ -2441,7 +2432,7 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)if (psnap->dsap !=0xaa || psnap->ssap !=0xaa || psnap->ctrl !=3 ) {/* not a snap type so leave it alone */ -DEBUG (3 ,"ray_cs untranslate NOT SNAP %02x %02x %02x\n" , +pr_debug ("ray_cs untranslate NOT SNAP %02x %02x %02x\n" , psnap->dsap, psnap->ssap, psnap->ctrl); delta =RX_MAC_HEADER_LENGTH -ETH_HLEN ;
@@ -2450,7 +2441,7 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len) }else {/* Its a SNAP */ if (memcmp (psnap->org, org_bridge,3 ) ==0 ) {/* EtherII and nuke the LLC */ -DEBUG (3 ,"ray_cs untranslate Bridge encap\n" ); +pr_debug ("ray_cs untranslate Bridge encap\n" ); delta =RX_MAC_HEADER_LENGTH +sizeof (struct snaphdr_t ) -ETH_HLEN ; peth = (struct ethhdr *)(skb->data + delta);
@@ -2459,14 +2450,14 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)switch (ntohs (type)) {case ETH_P_IPX :case ETH_P_AARP : -DEBUG (3 ,"ray_cs untranslate RFC IPX/AARP\n" ); +pr_debug ("ray_cs untranslate RFC IPX/AARP\n" ); delta =RX_MAC_HEADER_LENGTH -ETH_HLEN ; peth = (struct ethhdr *)(skb->data + delta); peth->h_proto =htons (len -RX_MAC_HEADER_LENGTH );break ;default : -DEBUG (3 ,"ray_cs untranslate RFC default\n" ); +pr_debug ("ray_cs untranslate RFC default\n" ); delta =RX_MAC_HEADER_LENGTH +sizeof (struct snaphdr_t ) -ETH_HLEN ; peth = (struct ethhdr *)(skb->data + delta);
@@ -2482,12 +2473,12 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len) }/* TBD reserve skb_reserve(skb, delta); */ skb_pull (skb, delta); -DEBUG (3 ,"untranslate after skb_pull(%d), skb->data = %p\n" , delta, +pr_debug ("untranslate after skb_pull(%d), skb->data = %p\n" , delta, skb->data);memcpy (peth->h_dest, destaddr,ADDRLEN );memcpy (peth->h_source, srcaddr,ADDRLEN ); -#ifdef PCMCIA_DEBUG -if (pc_debug >3 ) { +#if 0 + {int i;printk (KERN_DEBUG "skb->data after untranslate:" );for (i =0 ; i <64 ; i++)
@@ -2529,7 +2520,7 @@ static void release_frag_chain(ray_dev_t *local, struct rcs __iomem *prcs)while (tmp--) {writeb (CCS_BUFFER_FREE , &prcslink->buffer_status);if (rcsindex >= (NUMBER_OF_CCS +NUMBER_OF_RCS )) { -DEBUG (1 ,"ray_cs interrupt bad rcsindex = 0x%x\n" , +pr_debug ("ray_cs interrupt bad rcsindex = 0x%x\n" , rcsindex);break ; }
@@ -2543,9 +2534,9 @@ static void release_frag_chain(ray_dev_t *local, struct rcs __iomem *prcs)static void authenticate (ray_dev_t *local) {struct pcmcia_device *link = local->finder; -DEBUG (0 ,"ray_cs Starting authentication.\n" ); +dev_dbg (&link->dev,"ray_cs Starting authentication.\n" );if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_cs authenticate - device not present\n" ); +dev_dbg (&link->dev,"ray_cs authenticate - device not present\n" );return ; }
@@ -2573,11 +2564,11 @@ static void rx_authenticate(ray_dev_t *local, struct rcs __iomem *prcs,copy_from_rx_buff (local, buff, pkt_addr, rx_len &0xff );/* if we are trying to get authenticated */ if (local->sparm.b4.a_network_type ==ADHOC ) { -DEBUG (1 ,"ray_cs rx_auth var= %02x %02x %02x %02x %02x %02x\n" , +pr_debug ("ray_cs rx_auth var= %02x %02x %02x %02x %02x %02x\n" , msg->var[0 ], msg->var[1 ], msg->var[2 ], msg->var[3 ], msg->var[4 ], msg->var[5 ]);if (msg->var[2 ] ==1 ) { -DEBUG (0 ,"ray_cs Sending authentication response.\n" ); +pr_debug ("ray_cs Sending authentication response.\n" );if (!build_auth_frame (local, msg->mac.addr_2,OPEN_AUTH_RESPONSE )) { local->authentication_state =NEED_TO_AUTH ;
@@ -2591,13 +2582,13 @@ static void rx_authenticate(ray_dev_t *local, struct rcs __iomem *prcs,/* Verify authentication sequence #2 and success */ if (msg->var[2 ] ==2 ) {if ((msg->var[3 ] | msg->var[4 ]) ==0 ) { -DEBUG (1 ,"Authentication successful\n" ); +pr_debug ("Authentication successful\n" ); local->card_status =CARD_AUTH_COMPLETE ;associate (local); local->authentication_state =AUTHENTICATED ; }else { -DEBUG (0 ,"Authentication refused\n" ); +pr_debug ("Authentication refused\n" ); local->card_status =CARD_AUTH_REFUSED ;join_net ((u_long ) local); local->authentication_state =
@@ -2617,22 +2608,22 @@ static void associate(ray_dev_t *local)struct net_device *dev = link->priv;int ccsindex;if (!(pcmcia_dev_present (link))) { -DEBUG (2 ,"ray_cs associate - device not present\n" ); +dev_dbg (&link->dev,"ray_cs associate - device not present\n" );return ; }/* If no tx buffers available, return */ if ((ccsindex =get_free_ccs (local)) <0 ) {/* TBD should never be here but... what if we are? */ -DEBUG (1 ,"ray_cs associate - No free ccs\n" ); +dev_dbg (&link->dev,"ray_cs associate - No free ccs\n" );return ; } -DEBUG (1 ,"ray_cs Starting association with access point\n" ); +dev_dbg (&link->dev,"ray_cs Starting association with access point\n" ); pccs =ccs_base (local) + ccsindex;/* fill in the CCS */ writeb (CCS_START_ASSOCIATION , &pccs->cmd);/* Interrupt the firmware to process the command */ if (interrupt_ecf (local, ccsindex)) { -DEBUG (1 ,"ray_cs associate failed - ECF not ready for intr\n" ); +dev_dbg (&link->dev,"ray_cs associate failed - ECF not ready for intr\n" );writeb (CCS_BUFFER_FREE , &(pccs++)->buffer_status);del_timer (&local->timer);
@@ -2655,7 +2646,7 @@ static void rx_deauthenticate(ray_dev_t *local, struct rcs __iomem *prcs,/* UCHAR buff[256]; struct rx_msg *msg = (struct rx_msg *)buff; */ -DEBUG (0 ,"Deauthentication frame received\n" ); +pr_debug ("Deauthentication frame received\n" ); local->authentication_state =UNAUTHENTICATED ;/* Need to reauthenticate or rejoin depending on reason code */ /* copy_from_rx_buff(local, buff, pkt_addr, rx_len & 0xff);
@@ -2823,7 +2814,7 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)/* If no tx buffers available, return */ if ((ccsindex =get_free_tx_ccs (local)) <0 ) { -DEBUG (1 ,"ray_cs send authenticate - No free tx ccs\n" ); +pr_debug ("ray_cs send authenticate - No free tx ccs\n" );return -1 ; }
@@ -2855,7 +2846,7 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)/* Interrupt the firmware to process the command */ if (interrupt_ecf (local, ccsindex)) { -DEBUG (1 , +pr_debug ("ray_cs send authentication request failed - ECF not ready for intr\n" );writeb (CCS_BUFFER_FREE , &(pccs++)->buffer_status);return -1 ;
@@ -2942,9 +2933,9 @@ static int __init init_ray_cs(void) {int rc; -DEBUG (1 ,"%s\n" , rcsid); +pr_debug ("%s\n" , rcsid); rc =pcmcia_register_driver (&ray_driver); -DEBUG (1 ,"raylink init_module register_pcmcia_driver returns 0x%x\n" , +pr_debug ("raylink init_module register_pcmcia_driver returns 0x%x\n" , rc);#ifdef CONFIG_PROC_FS
@@ -2964,7 +2955,7 @@ static int __init init_ray_cs(void) static void __exit exit_ray_cs(void) { -DEBUG (0 ,"ray_cs: cleanup_module\n" ); +pr_debug ("ray_cs: cleanup_module\n" );#ifdef CONFIG_PROC_FS remove_proc_entry ("driver/ray_cs/ray_cs" ,NULL );
Signature · 6 lines
1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 13/16 pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (sound)
In reply to Dominik BrodowskiConvert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of PCMCIA_DEBUG.
Also, remove all usages of the CS_CHECK macro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
--- sound/pcmcia/pdaudiocf/pdaudiocf.c | 21 ++++++++++++--------- sound/pcmcia/vx/vxpocket.c | 21 ++++++++++++--------- 2 files changed, 24 insertions(+), 18 deletions(-)
sound/pcmcia/pdaudiocf/pdaudiocf.c +12 -9
@@ -217,20 +217,25 @@ static void snd_pdacf_detach(struct pcmcia_device *link)* configuration callback */ -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) -static int pdacf_config (struct pcmcia_device *link) {struct snd_pdacf *pdacf = link->priv; -int last_fn, last_ret; +int ret;snd_printdd (KERN_DEBUG "pdacf_config called\n" ); link->conf.ConfigIndex =0x5 ; -CS_CHECK (RequestIO,pcmcia_request_io (link, &link->io)); -CS_CHECK (RequestIRQ,pcmcia_request_irq (link, &link->irq)); -CS_CHECK (RequestConfiguration,pcmcia_request_configuration (link, &link->conf)); + ret =pcmcia_request_io (link, &link->io); +if (ret) + goto failed; + + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed; + + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) + goto failed;if (snd_pdacf_assign_resources (pdacf, link->io.BasePort1, link->irq.AssignedIRQ) <0 ) goto failed;
@@ -238,8 +243,6 @@ static int pdacf_config(struct pcmcia_device *link) link->dev_node = &pdacf->node;return 0 ; -cs_failed: -cs_error (link, last_fn, last_ret); failed:pcmcia_disable_device (link);return -ENODEV ;
sound/pcmcia/vx/vxpocket.c +12 -9
@@ -213,14 +213,11 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq* configuration callback */ -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) -static int vxpocket_config (struct pcmcia_device *link) {struct vx_core *chip = link->priv;struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; -int last_fn, last_ret; +int ret;snd_printdd (KERN_DEBUG "vxpocket_config called\n" );
@@ -235,9 +232,17 @@ static int vxpocket_config(struct pcmcia_device *link)strcpy (chip->card->driver, vxp440_hw.name); } -CS_CHECK (RequestIO,pcmcia_request_io (link, &link->io)); -CS_CHECK (RequestIRQ,pcmcia_request_irq (link, &link->irq)); -CS_CHECK (RequestConfiguration,pcmcia_request_configuration (link, &link->conf)); + ret =pcmcia_request_io (link, &link->io); +if (ret) + goto failed; + + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed; + + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) + goto failed; chip->dev = &handle_to_dev (link);snd_card_set_dev (chip->card, chip->dev);
@@ -248,8 +253,6 @@ static int vxpocket_config(struct pcmcia_device *link) link->dev_node = &vxp->node;return 0 ; -cs_failed: -cs_error (link, last_fn, last_ret); failed:pcmcia_disable_device (link);return -ENODEV ;
Signature · 1 line
1.6.0.4
PATCH 8/16 pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (net)
In reply to Dominik BrodowskiConvert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of PCMCIA_DEBUG. Only some rare debug checks are now hidden behind "#ifdef DEBUG" or "#if 0".
Also, remove all usages of the CS_CHECK macro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
--- drivers/net/pcmcia/3c574_cs.c | 66 ++++++++---------- drivers/net/pcmcia/3c589_cs.c | 75 +++++++------------- drivers/net/pcmcia/axnet_cs.c | 53 +++++--------- drivers/net/pcmcia/com20020_cs.c | 55 ++++++-------- drivers/net/pcmcia/fmvj18x_cs.c | 109 ++++++++++------------------ drivers/net/pcmcia/ibmtr_cs.c | 54 +++++++------- drivers/net/pcmcia/nmclan_cs.c | 148 +++++++++++++++---------------------- drivers/net/pcmcia/pcnet_cs.c | 67 +++++++----------- drivers/net/pcmcia/smc91c92_cs.c | 85 ++++++++-------------- drivers/net/pcmcia/xirc2ps_cs.c | 111 +++++++++++------------------ 10 files changed, 315 insertions(+), 508 deletions(-)
drivers/net/pcmcia/3c574_cs.c +29 -37
@@ -118,14 +118,6 @@ INT_MODULE_PARM(full_duplex, 0);/* Autodetect link polarity reversal? */ INT_MODULE_PARM (auto_polarity,1 ); -#ifdef PCMCIA_DEBUG -INT_MODULE_PARM (pc_debug,PCMCIA_DEBUG ); -#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -static char *version = -"3c574_cs.c 1.65ac1 2003/04/07 Donald Becker/David Hinds, [email protected].\n" ; -#else -#define DEBUG(n, args...) -#endif /*====================================================================*/
@@ -278,7 +270,7 @@ static int tc574_probe(struct pcmcia_device *link)struct el3_private *lp;struct net_device *dev; -DEBUG (0 ,"3c574_attach()\n" ); +dev_dbg (&link->dev,"3c574_attach()\n" );/* Create the PC card device object. */ dev =alloc_etherdev (sizeof (struct el3_private ));
@@ -319,7 +311,7 @@ static void tc574_detach(struct pcmcia_device *link) {struct net_device *dev = link->priv; -DEBUG (0 ,"3c574_detach(0x%p)\n" , link); +dev_dbg (&link->dev,"3c574_detach()\n" );if (link->dev_node)unregister_netdev (dev);
@@ -335,16 +327,13 @@ static void tc574_detach(struct pcmcia_device *link)ethernet device available to the system. */ -#define CS_CHECK (fn, ret) \ - do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) -static const char *ram_split[] = {"5:3" ,"3:1" ,"1:1" ,"3:5" };static int tc574_config (struct pcmcia_device *link) {struct net_device *dev = link->priv;struct el3_private *lp =netdev_priv (dev); -int last_fn, last_ret, i, j; +int ret, i, j;unsigned int ioaddr;__be16 *phys_addr;char *cardname;
@@ -354,7 +343,7 @@ static int tc574_config(struct pcmcia_device *link) phys_addr = (__be16 *)dev->dev_addr; -DEBUG (0 ,"3c574_config(0x%p)\n" , link); +dev_dbg (&link->dev,"3c574_config()\n" ); link->io.IOAddrLines =16 ;for (i = j =0 ; j <0x400 ; j +=0x20 ) {
@@ -363,12 +352,16 @@ static int tc574_config(struct pcmcia_device *link)if (i ==0 )break ; } -if (i !=0 ) { -cs_error (link, RequestIO, i); +if (i !=0 ) + goto failed; + + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed; + + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) goto failed; - } -CS_CHECK (RequestIRQ,pcmcia_request_irq (link, &link->irq)); -CS_CHECK (RequestConfiguration,pcmcia_request_configuration (link, &link->conf)); dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1;
@@ -433,7 +426,8 @@ static int tc574_config(struct pcmcia_device *link) mii_status =mdio_read (ioaddr, phy &0x1f ,1 );if (mii_status !=0xffff ) { lp->phys = phy &0x1f ; -DEBUG (0 ," MII transceiver at index %d, status %x.\n" , +dev_dbg (&link->dev," MII transceiver at " +"index %d, status %x.\n" , phy, mii_status);if ((mii_status &0x0040 ) ==0 ) mii_preamble_required =1 ;
@@ -476,8 +470,6 @@ static int tc574_config(struct pcmcia_device *link)return 0 ; -cs_failed: -cs_error (link, last_fn, last_ret); failed:tc574_release (link);return -ENODEV ;
@@ -736,7 +728,7 @@ static int el3_open(struct net_device *dev) lp->media.expires = jiffies +HZ ;add_timer (&lp->media); -DEBUG (2 ,"%s: opened, status %4.4x.\n" , +dev_dbg (&link->dev,"%s: opened, status %4.4x.\n" , dev->name,inw (dev->base_addr +EL3_STATUS ));return 0 ;
@@ -770,7 +762,7 @@ static void pop_tx_status(struct net_device *dev)if (tx_status &0x30 )tc574_wait_for_completion (dev, TxReset);if (tx_status &0x38 ) { -DEBUG (1 ,"%s: transmit error: status 0x%02x\n" , +pr_debug ("%s: transmit error: status 0x%02x\n" , dev->name, tx_status);outw (TxEnable, ioaddr +EL3_CMD ); dev->stats.tx_aborted_errors++;
@@ -786,7 +778,7 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb,struct el3_private *lp =netdev_priv (dev);unsigned long flags; -DEBUG (3 ,"%s: el3_start_xmit(length = %ld) called, " +pr_debug ("%s: el3_start_xmit(length = %ld) called, " "status %4.4x.\n" , dev->name, (long )skb->len,inw (ioaddr +EL3_STATUS ));
@@ -825,7 +817,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)return IRQ_NONE ; ioaddr = dev->base_addr; -DEBUG (3 ,"%s: interrupt, status %4.4x.\n" , +pr_debug ("%s: interrupt, status %4.4x.\n" , dev->name,inw (ioaddr +EL3_STATUS ));spin_lock (&lp->window_lock);
@@ -834,7 +826,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id) (IntLatch | RxComplete | RxEarly | StatsFull)) {if (!netif_device_present (dev) || ((status &0xe000 ) !=0x2000 )) { -DEBUG (1 ,"%s: Interrupt from dead card\n" , dev->name); +pr_debug ("%s: Interrupt from dead card\n" , dev->name);break ; }
@@ -844,7 +836,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id) work_budget =el3_rx (dev, work_budget);if (status & TxAvailable) { -DEBUG (3 ," TX room bit was handled.\n" ); +pr_debug (" TX room bit was handled.\n" );/* There's room in the FIFO for a full-sized packet. */ outw (AckIntr | TxAvailable, ioaddr +EL3_CMD );netif_wake_queue (dev);
@@ -884,7 +876,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id) }if (--work_budget <0 ) { -DEBUG (0 ,"%s: Too much work in interrupt, " +pr_debug ("%s: Too much work in interrupt, " "status %4.4x.\n" , dev->name, status);/* Clear all interrupts */ outw (AckIntr |0xFF , ioaddr +EL3_CMD );
@@ -894,7 +886,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)outw (AckIntr | IntReq | IntLatch, ioaddr +EL3_CMD ); } -DEBUG (3 ,"%s: exiting interrupt, status %4.4x.\n" , +pr_debug ("%s: exiting interrupt, status %4.4x.\n" , dev->name,inw (ioaddr +EL3_STATUS ));spin_unlock (&lp->window_lock);
@@ -1001,7 +993,7 @@ static void update_stats(struct net_device *dev)unsigned int ioaddr = dev->base_addr;u8 rx, tx, up; -DEBUG (2 ,"%s: updating the statistics.\n" , dev->name); +pr_debug ("%s: updating the statistics.\n" , dev->name);if (inw (ioaddr+EL3_STATUS ) ==0xffff )/* No card. */ return ;
@@ -1037,7 +1029,7 @@ static int el3_rx(struct net_device *dev, int worklimit)unsigned int ioaddr = dev->base_addr;short rx_status; -DEBUG (3 ,"%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n" , +pr_debug ("%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n" , dev->name,inw (ioaddr+EL3_STATUS ),inw (ioaddr+RxStatus));while (!((rx_status =inw (ioaddr + RxStatus)) &0x8000 ) && worklimit >0 ) {
@@ -1059,7 +1051,7 @@ static int el3_rx(struct net_device *dev, int worklimit) skb =dev_alloc_skb (pkt_len+5 ); -DEBUG (3 ," Receiving packet size %d status %4.4x.\n" , +pr_debug (" Receiving packet size %d status %4.4x.\n" , pkt_len, rx_status);if (skb !=NULL ) {skb_reserve (skb,2 );
@@ -1070,7 +1062,7 @@ static int el3_rx(struct net_device *dev, int worklimit) dev->stats.rx_packets++; dev->stats.rx_bytes += pkt_len; }else { -DEBUG (1 ,"%s: couldn't allocate a sk_buff of" +pr_debug ("%s: couldn't allocate a sk_buff of" " size %d.\n" , dev->name, pkt_len); dev->stats.rx_dropped++; }
@@ -1099,7 +1091,7 @@ static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)struct mii_ioctl_data *data =if_mii (rq);int phy = lp->phys &0x1f ; -DEBUG (2 ,"%s: In ioct(%-.6s, %#4.4x) %4.4x %4.4x %4.4x %4.4x.\n" , +pr_debug ("%s: In ioct(%-.6s, %#4.4x) %4.4x %4.4x %4.4x %4.4x.\n" , dev->name, rq->ifr_ifrn.ifrn_name, cmd, data->phy_id, data->reg_num, data->val_in, data->val_out);
@@ -1176,7 +1168,7 @@ static int el3_close(struct net_device *dev)struct el3_private *lp =netdev_priv (dev);struct pcmcia_device *link = lp->p_dev; -DEBUG (2 ,"%s: shutting down ethercard.\n" , dev->name); +dev_dbg (&link->dev,"%s: shutting down ethercard.\n" , dev->name);if (pcmcia_dev_present (link)) {unsigned long flags;
drivers/net/pcmcia/3c589_cs.c +25 -50
202 lines not on this page · raw message
drivers/net/pcmcia/axnet_cs.c +18 -35
131 lines not on this page · raw message
drivers/net/pcmcia/com20020_cs.c +24 -31
156 lines not on this page · raw message
drivers/net/pcmcia/fmvj18x_cs.c +38 -71
275 lines not on this page · raw message
drivers/net/pcmcia/ibmtr_cs.c +26 -28
129 lines not on this page · raw message
drivers/net/pcmcia/nmclan_cs.c +60 -88
363 lines not on this page · raw message
drivers/net/pcmcia/pcnet_cs.c +25 -42
188 lines not on this page · raw message
drivers/net/pcmcia/smc91c92_cs.c +29 -56
245 lines not on this page · raw message
drivers/net/pcmcia/xirc2ps_cs.c +41 -70
345 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 11/16 pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (scsi)
In reply to Dominik BrodowskiConvert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of PCMCIA_DEBUG.
Also, remove all usages of the CS_CHECK macro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
--- drivers/scsi/pcmcia/aha152x_stub.c | 40 +++++++++++--------------------- drivers/scsi/pcmcia/fdomain_stub.c | 43 ++++++++++++---------------------- drivers/scsi/pcmcia/qlogic_stub.c | 44 +++++++++++++---------------------- drivers/scsi/pcmcia/sym53c500_cs.c | 41 +++++++++++---------------------- 4 files changed, 59 insertions(+), 109 deletions(-)
drivers/scsi/pcmcia/aha152x_stub.c +14 -26
@@ -54,15 +54,6 @@#include <pcmcia/cistpl.h> #include <pcmcia/ds.h> -#ifdef PCMCIA_DEBUG -static int pc_debug =PCMCIA_DEBUG ; -module_param (pc_debug, int,0644 ); -#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -static char *version = -"aha152x_cs.c 1.54 2000/06/12 21:27:25 (David Hinds)" ; -#else -#define DEBUG(n, args...) -#endif /*====================================================================*/
@@ -103,7 +94,7 @@ static int aha152x_probe(struct pcmcia_device *link) {scsi_info_t *info; -DEBUG (0 ,"aha152x_attach()\n" ); +dev_dbg (&link->dev,"aha152x_attach()\n" );/* Create new SCSI device */ info =kzalloc (sizeof (*info),GFP_KERNEL );
@@ -127,7 +118,7 @@ static int aha152x_probe(struct pcmcia_device *link)static void aha152x_detach (struct pcmcia_device *link) { -DEBUG (0 ,"aha152x_detach(0x%p)\n" , link); +dev_dbg (&link->dev,"aha152x_detach\n" );aha152x_release_cs (link);
@@ -137,9 +128,6 @@ static void aha152x_detach(struct pcmcia_device *link)/*====================================================================*/ -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) - static int aha152x_config_check(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cfg, cistpl_cftable_entry_t *dflt,
@@ -164,19 +152,21 @@ static int aha152x_config_cs(struct pcmcia_device *link) {scsi_info_t *info = link->priv;struct aha152x_setup s; -int last_ret, last_fn; + int retstruct Scsi_Host *host; -DEBUG (0 ,"aha152x_config(0x%p)\n" , link); +dev_dbg (&link->dev,"aha152x_config\n" ); - last_ret =pcmcia_loop_config (link, aha152x_config_check,NULL ); -if (last_ret) { -cs_error (link, RequestIO, last_ret); - goto failed; - } + ret =pcmcia_loop_config (link, aha152x_config_check,NULL ); +if (ret) + goto failed; -CS_CHECK (RequestIRQ,pcmcia_request_irq (link, &link->irq)); -CS_CHECK (RequestConfiguration,pcmcia_request_configuration (link, &link->conf)); + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed; + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) + goto failed;/* Set configuration options for the aha152x driver */ memset (&s,0 ,sizeof (s));
@@ -194,7 +184,7 @@ static int aha152x_config_cs(struct pcmcia_device *link) host =aha152x_probe_one (&s);if (host ==NULL ) {printk (KERN_INFO "aha152x_cs: no SCSI devices found\n" ); - goto cs_failed; + goto failed; }sprintf (info->node.dev_name,"scsi%d" , host->host_no);
@@ -203,8 +193,6 @@ static int aha152x_config_cs(struct pcmcia_device *link)return 0 ; -cs_failed: -cs_error (link, last_fn, last_ret); failed:aha152x_release_cs (link);return -ENODEV ;
drivers/scsi/pcmcia/fdomain_stub.c +15 -28
100 lines not on this page · raw message
drivers/scsi/pcmcia/qlogic_stub.c +16 -28
99 lines not on this page · raw message
drivers/scsi/pcmcia/sym53c500_cs.c +14 -27
93 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 12/16 pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (serial_cs)
In reply to Dominik BrodowskiConvert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of PCMCIA_DEBUG.
Also, remove all usages of the CS_CHECK macro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
--- drivers/serial/serial_cs.c | 53 ++++++++++++++----------------------------- 1 files changed, 17 insertions(+), 36 deletions(-)
drivers/serial/serial_cs.c +17 -36
@@ -54,14 +54,6 @@#include "8250.h" -#ifdef PCMCIA_DEBUG -static int pc_debug =PCMCIA_DEBUG ; -module_param (pc_debug, int,0644 ); -#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -static char *version ="serial_cs.c 1.134 2002/05/04 05:48:53 (David Hinds)" ; -#else -#define DEBUG(n, args...) -#endif /*====================================================================*/
@@ -121,24 +113,20 @@ 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 }; -int last_ret, last_fn; +int ret; + + ret =pcmcia_access_configuration_register (link, ®); +if (ret) + goto failed; - last_ret =pcmcia_access_configuration_register (link, ®); -if (last_ret) { - last_fn = AccessConfigurationRegister; - goto cs_failed; - } reg.Action =CS_WRITE ; reg.Value = reg.Value |1 ; - last_ret =pcmcia_access_configuration_register (link, ®); -if (last_ret) { - last_fn = AccessConfigurationRegister; - goto cs_failed; - } + ret =pcmcia_access_configuration_register (link, ®); +if (ret) + goto failed;return 0 ; - cs_failed: -cs_error (link, last_fn, last_ret); + failed:return -ENODEV ; }
@@ -283,7 +271,7 @@ static void serial_remove(struct pcmcia_device *link)struct serial_info *info = link->priv;int i; -DEBUG (0 ,"serial_release(0x%p)\n" , link); +dev_dbg (&link->dev,"serial_release\n" );/* * Recheck to see if the device is still configured.
@@ -334,7 +322,7 @@ static int serial_probe(struct pcmcia_device *link) {struct serial_info *info; -DEBUG (0 ,"serial_attach()\n" ); +dev_dbg (&link->dev,"serial_attach()\n" );/* Create new serial device */ info =kzalloc (sizeof (*info),GFP_KERNEL );
@@ -370,7 +358,7 @@ static void serial_detach(struct pcmcia_device *link) {struct serial_info *info = link->priv; -DEBUG (0 ,"serial_detach(0x%p)\n" , link); +dev_dbg (&link->dev,"serial_detach\n" );/* * Ensure any outstanding scheduled tasks are completed.
@@ -507,15 +495,13 @@ static int simple_config(struct pcmcia_device *link)printk (KERN_NOTICE "serial_cs: no usable port range found, giving up\n" ); -cs_error (link, RequestIO, i);return -1 ; found_port: i =pcmcia_request_irq (link, &link->irq); -if (i !=0 ) { -cs_error (link, RequestIRQ, i); +if (i !=0 ) link->irq.AssignedIRQ =0 ; - } +if (info->multi && (info->manfid ==MANFID_3COM )) link->conf.ConfigIndex &= ~(0x08 );
@@ -526,10 +512,8 @@ found_port: info->quirk->config (link); i =pcmcia_request_configuration (link, &link->conf); -if (i !=0 ) { -cs_error (link, RequestConfiguration, i); +if (i !=0 )return -1 ; - }return setup_serial (link, info, link->io.BasePort1, link->irq.AssignedIRQ); }
@@ -598,7 +582,6 @@ static int multi_config(struct pcmcia_device *link)/* FIXME: comment does not fit, error handling does not fit */ printk (KERN_NOTICE "serial_cs: no usable port range found, giving up\n" ); -cs_error (link, RequestIRQ, i); link->irq.AssignedIRQ =0 ; }
@@ -609,10 +592,8 @@ static int multi_config(struct pcmcia_device *link) info->quirk->config (link); i =pcmcia_request_configuration (link, &link->conf); -if (i !=0 ) { -cs_error (link, RequestConfiguration, i); +if (i !=0 )return -ENODEV ; - }/* The Oxford Semiconductor OXCF950 cards are in fact single-port: * 8 registers are for the UART, the others are extra registers.
@@ -682,7 +663,7 @@ static int serial_config(struct pcmcia_device * link)struct serial_info *info = link->priv;int i; -DEBUG (0 ,"serial_config(0x%p)\n" , link); +dev_dbg (&link->dev,"serial_config\n" );/* Is this a compliant multifunction card? */ info->multi = (link->socket->functions >1 );
Signature · 1 line
1.6.0.4
PATCH 4/16 pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ide)
In reply to Dominik Brodowskiide-cs.c is the only PCMCIA device driver making use of CONFIG_PCMCIA_DEBUG, so convert it to use the dynamic debug infrastructure.
Also, remove all usages of the CS_CHECK macro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
--- drivers/ata/pata_pcmcia.c | 16 ++++++++-------- drivers/ide/ide-cs.c | 32 +++++++++++--------------------- 2 files changed, 19 insertions(+), 29 deletions(-)
drivers/ata/pata_pcmcia.c +8 -8
@@ -177,9 +177,6 @@ static struct ata_port_operations pcmcia_8bit_port_ops = { .drain_fifo = pcmcia_8bit_drain_fifo, }; -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) -struct pcmcia_config_check {unsigned long ctl_base;
@@ -252,7 +249,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)struct ata_port *ap;struct ata_pcmcia_info *info;struct pcmcia_config_check *stk =NULL ; -int last_ret =0 , last_fn =0 , is_kme =0 , ret = -ENOMEM , p; +int is_kme =0 , ret = -ENOMEM , p;unsigned long io_base, ctl_base;void __iomem *io_addr, *ctl_addr;int n_ports =1 ;
@@ -296,8 +293,13 @@ static int pcmcia_init_one(struct pcmcia_device *pdev) } io_base = pdev->io.BasePort1; ctl_base = stk->ctl_base; -CS_CHECK (RequestIRQ,pcmcia_request_irq (pdev, &pdev->irq)); -CS_CHECK (RequestConfiguration,pcmcia_request_configuration (pdev, &pdev->conf)); + ret =pcmcia_request_irq (pdev, &pdev->irq); +if (ret) + goto failed; + + ret =pcmcia_request_configuration (pdev, &pdev->conf); +if (ret) + goto failed;/* iomap */ ret = -ENOMEM ;
@@ -351,8 +353,6 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)kfree (stk);return 0 ; -cs_failed: -cs_error (pdev, last_fn, last_ret); failed:kfree (stk); info->ndev =0 ;
drivers/ide/ide-cs.c +11 -21
@@ -60,15 +60,6 @@ MODULE_AUTHOR("David Hinds <[email protected]>");MODULE_DESCRIPTION ("PCMCIA ATA/IDE card driver" );MODULE_LICENSE ("Dual MPL/GPL" ); -#define INT_MODULE_PARM (n, v) static int n = v; module_param(n, int, 0) - -#ifdef CONFIG_PCMCIA_DEBUG -INT_MODULE_PARM (pc_debug,0 ); -#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -#else -#define DEBUG(n, args...) -#endif -/*====================================================================*/ typedef struct ide_info_t {
@@ -98,7 +89,7 @@ static int ide_probe(struct pcmcia_device *link) {ide_info_t *info; -DEBUG (0 ,"ide_attach()\n" ); +dev_dbg (&link->dev,"ide_attach()\n" );/* Create new ide device */ info =kzalloc (sizeof (*info),GFP_KERNEL );
@@ -134,7 +125,7 @@ static void ide_detach(struct pcmcia_device *link)ide_hwif_t *hwif = info->host->ports[0 ];unsigned long data_addr, ctl_addr; -DEBUG (0 ,"ide_detach(0x%p)\n" , link); +dev_dbg (&link->dev,"ide_detach(0x%p)\n" , link); data_addr = hwif->io_ports.data_addr; ctl_addr = hwif->io_ports.ctl_addr;
@@ -217,9 +208,6 @@ out_release:======================================================================*/ -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) -struct pcmcia_config_check {unsigned long ctl_base;int skip_vcc;
@@ -282,11 +270,11 @@ static int ide_config(struct pcmcia_device *link) {ide_info_t *info = link->priv;struct pcmcia_config_check *stk =NULL ; -int last_ret =0 , last_fn =0 , is_kme =0 ; +int ret =0 , is_kme =0 ;unsigned long io_base, ctl_base;struct ide_host *host; -DEBUG (0 ,"ide_config(0x%p)\n" , link); +dev_dbg (&link->dev,"ide_config(0x%p)\n" , link); is_kme = ((link->manf_id == MANFID_KME) && ((link->card_id == PRODID_KME_KXLC005_A) ||
@@ -306,8 +294,12 @@ static int ide_config(struct pcmcia_device *link) io_base = link->io.BasePort1; ctl_base = stk->ctl_base; -CS_CHECK (RequestIRQ,pcmcia_request_irq (link, &link->irq)); -CS_CHECK (RequestConfiguration,pcmcia_request_configuration (link, &link->conf)); + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed; + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) + goto failed;/* disable drive interrupts during IDE probe */ outb (0x02 , ctl_base);
@@ -342,8 +334,6 @@ err_mem:printk (KERN_NOTICE "ide-cs: ide_config failed memory allocation\n" ); goto failed; -cs_failed: -cs_error (link, last_fn, last_ret); failed:kfree (stk);ide_release (link);
@@ -363,7 +353,7 @@ static void ide_release(struct pcmcia_device *link)ide_info_t *info = link->priv;struct ide_host *host = info->host; -DEBUG (0 ,"ide_release(0x%p)\n" , link); +dev_dbg (&link->dev,"ide_release(0x%p)\n" , link);if (info->ndev)/* FIXME: if this fails we need to queue the cleanup somehow
Signature · 1 line
1.6.0.4
PATCH 10/16 pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (wireless)
In reply to Dominik BrodowskiConvert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of PCMCIA_DEBUG.
Also, remove all usages of the CS_CHECK macro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
--- drivers/net/wireless/airo_cs.c | 48 +++++---------- drivers/net/wireless/atmel_cs.c | 46 +++++---------- drivers/net/wireless/hostap/hostap_cs.c | 23 +++----- drivers/net/wireless/netwave_cs.c | 88 +++++++++++---------------- drivers/net/wireless/orinoco/orinoco_cs.c | 27 +++----- drivers/net/wireless/orinoco/spectrum_cs.c | 54 +++++++++--------- drivers/net/wireless/wavelan_cs.c | 24 -------- drivers/net/wireless/wl3501_cs.c | 67 ++++++++-------------- 8 files changed, 136 insertions(+), 241 deletions(-)
drivers/net/wireless/airo_cs.c +16 -32
@@ -43,21 +43,6 @@#include "airo.h" -/* -All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If -you do not define PCMCIA_DEBUG at all, all the debug code will be -left out. If you compile with PCMCIA_DEBUG=0, the debug code will -be present but disabled -- but it can then be enabled for specific -modules at load time with a 'pc_debug=#' option to insmod. -*/ -#ifdef PCMCIA_DEBUG -static int pc_debug =PCMCIA_DEBUG ; -module_param (pc_debug, int,0 ); -static char *version ="$Revision: 1.2 $" ; -#define DEBUG(n, args...) if (pc_debug > (n)) printk(KERN_DEBUG args); -#else -#define DEBUG(n, args...) -#endif /*====================================================================*/
@@ -145,7 +130,7 @@ static int airo_probe(struct pcmcia_device *p_dev) {local_info_t *local; -DEBUG (0 ,"airo_attach()\n" ); +dev_dbg (&p_dev->dev,"airo_attach()\n" );/* Interrupt setup */ p_dev->irq.Attributes =IRQ_TYPE_DYNAMIC_SHARING ;
@@ -184,7 +169,7 @@ static int airo_probe(struct pcmcia_device *p_dev)static void airo_detach (struct pcmcia_device *link) { -DEBUG (0 ,"airo_detach(0x%p)\n" , link); +dev_dbg (&link->dev,"airo_detach\n" );airo_release (link);
@@ -204,9 +189,6 @@ static void airo_detach(struct pcmcia_device *link)======================================================================*/ -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) - static int airo_cs_config_check(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cfg, cistpl_cftable_entry_t *dflt,
@@ -291,11 +273,11 @@ static int airo_config(struct pcmcia_device *link) {local_info_t *dev;win_req_t *req; -int last_fn, last_ret; +int ret; dev = link->priv; -DEBUG (0 ,"airo_config(0x%p)\n" , link); +dev_dbg (&link->dev,"airo_config\n" ); req =kzalloc (sizeof (win_req_t),GFP_KERNEL );if (!req)
@@ -315,8 +297,8 @@ static int airo_config(struct pcmcia_device *link)* and most client drivers will only use the CIS to fill in * implementation-defined details. */ - last_ret =pcmcia_loop_config (link, airo_cs_config_check, req); -if (last_ret) + ret =pcmcia_loop_config (link, airo_cs_config_check, req); +if (ret) goto failed;/*
@@ -324,21 +306,25 @@ static int airo_config(struct pcmcia_device *link)handler to the interrupt, unless the 'Handler' member of the irq structure is initialized. */ -if (link->conf.Attributes &CONF_ENABLE_IRQ ) -CS_CHECK (RequestIRQ,pcmcia_request_irq (link, &link->irq)); +if (link->conf.Attributes &CONF_ENABLE_IRQ ) { + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed; + }/* This actually configures the PCMCIA socket -- setting up the I/O windows and the interrupt mapping, and putting the card and host interface into "Memory and IO" mode. */ -CS_CHECK (RequestConfiguration, -pcmcia_request_configuration (link, &link->conf)); + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) + goto failed; ((local_info_t *)link->priv)->eth_dev =init_airo_card (link->irq.AssignedIRQ, link->io.BasePort1,1 , &handle_to_dev (link));if (!((local_info_t *)link->priv)->eth_dev) - goto cs_failed; + goto failed;/* At this point, the dev_node_t structure(s) need to be
@@ -368,8 +354,6 @@ static int airo_config(struct pcmcia_device *link)kfree (req);return 0 ; - cs_failed: -cs_error (link, last_fn, last_ret); failed:airo_release (link);kfree (req);
@@ -386,7 +370,7 @@ static int airo_config(struct pcmcia_device *link)static void airo_release (struct pcmcia_device *link) { -DEBUG (0 ,"airo_release(0x%p)\n" , link); +dev_dbg (&link->dev,"airo_release\n" );pcmcia_disable_device (link); }
drivers/net/wireless/atmel_cs.c +15 -31
115 lines not on this page · raw message
drivers/net/wireless/hostap/hostap_cs.c +8 -15
@@ -510,10 +510,6 @@ static void prism2_detach(struct pcmcia_device *link) } -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) - -/* run after a CARD_INSERTION event is received to configure the PCMCIA * socket and make the device available to the system */
@@ -605,7 +601,6 @@ static int prism2_config(struct pcmcia_device *link)struct hostap_interface *iface;local_info_t *local;int ret =1 ; -int last_fn, last_ret;struct hostap_cs_priv *hw_priv;PDEBUG (DEBUG_FLOW ,"prism2_config()\n" );
@@ -617,13 +612,12 @@ static int prism2_config(struct pcmcia_device *link) }/* Look for an appropriate configuration table entry in the CIS */ - last_ret =pcmcia_loop_config (link, prism2_config_check,NULL ); -if (last_ret) { + ret =pcmcia_loop_config (link, prism2_config_check,NULL ); +if (ret) {if (!ignore_cis_vcc)printk (KERN_ERR "GetNextTuple(): No matching " "CIS configuration. Maybe you need the " "ignore_cis_vcc=1 parameter.\n" ); -cs_error (link, RequestIO, last_ret); goto failed; }
@@ -652,8 +646,9 @@ static int prism2_config(struct pcmcia_device *link) link->irq.IRQInfo1 =IRQ_LEVEL_ID ; link->irq.Handler = prism2_interrupt; link->irq.Instance = dev; -CS_CHECK (RequestIRQ, -pcmcia_request_irq (link, &link->irq)); + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed; }/*
@@ -661,8 +656,9 @@ static int prism2_config(struct pcmcia_device *link)* the I/O windows and the interrupt mapping, and putting the * card and host interface into "Memory and IO" mode. */ -CS_CHECK (RequestConfiguration, -pcmcia_request_configuration (link, &link->conf)); + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) + goto failed; dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1;
@@ -695,9 +691,6 @@ static int prism2_config(struct pcmcia_device *link) }return ret; - cs_failed: -cs_error (link, last_fn, last_ret); - failed:kfree (hw_priv);prism2_release ((u_long )link);
drivers/net/wireless/netwave_cs.c +36 -52
251 lines not on this page · raw message
drivers/net/wireless/orinoco/orinoco_cs.c +10 -17
@@ -160,12 +160,6 @@ static void orinoco_cs_detach(struct pcmcia_device *link)* device available to the system. */ -#define CS_CHECK (fn, ret) do { \ - last_fn = (fn); \ - if ((last_ret = (ret)) != 0) \ - goto cs_failed; \ -} while (0) - static int orinoco_cs_config_check(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cfg, cistpl_cftable_entry_t *dflt,
@@ -240,7 +234,7 @@ orinoco_cs_config(struct pcmcia_device *link)struct orinoco_private *priv = link->priv;struct orinoco_pccard *card = priv->card;hermes_t *hw = &priv->hw; -int last_fn, last_ret; +int ret;void __iomem *mem;/*
@@ -257,13 +251,12 @@ orinoco_cs_config(struct pcmcia_device *link)* and most client drivers will only use the CIS to fill in * implementation-defined details. */ - last_ret =pcmcia_loop_config (link, orinoco_cs_config_check,NULL ); -if (last_ret) { + ret =pcmcia_loop_config (link, orinoco_cs_config_check,NULL ); +if (ret) {if (!ignore_cis_vcc) printk(KERN_ERR PFX "GetNextTuple(): No matching ""CIS configuration. Maybe you need the " "ignore_cis_vcc=1 parameter.\n" ); -cs_error (link, RequestIO, last_ret); goto failed; }
@@ -272,14 +265,16 @@ orinoco_cs_config(struct pcmcia_device *link)* a handler to the interrupt, unless the 'Handler' member of * the irq structure is initialized. */ -CS_CHECK (RequestIRQ,pcmcia_request_irq (link, &link->irq)); + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed;/* 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);if (!mem) - goto cs_failed; + goto failed;hermes_struct_init (hw, mem,HERMES_16BIT_REGSPACING );
@@ -288,8 +283,9 @@ orinoco_cs_config(struct pcmcia_device *link)* the I/O windows and the interrupt mapping, and putting the * card and host interface into "Memory and IO" mode. */ -CS_CHECK (RequestConfiguration, -pcmcia_request_configuration (link, &link->conf)); + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) + goto failed;/* Ok, we have the configuration, prepare to register the netdev */ card->node.major = card->node.minor =0 ;
@@ -315,9 +311,6 @@ orinoco_cs_config(struct pcmcia_device *link)* net_device has been registered */ return 0 ; - cs_failed: -cs_error (link, last_fn, last_ret); - failed:orinoco_cs_release (link);return -ENODEV ;
drivers/net/wireless/orinoco/spectrum_cs.c +27 -27
138 lines not on this page · raw message
drivers/net/wireless/wavelan_cs.c +0 -24
@@ -3656,10 +3656,7 @@ wv_pcmcia_reset(struct net_device * dev) i =pcmcia_access_configuration_register (link, ®);if (i !=0 ) - { -cs_error (link, AccessConfigurationRegister, i);return FALSE; - }#ifdef DEBUG_CONFIG_INFO printk(KERN_DEBUG "%s: wavelan_pcmcia_reset(): Config reg is 0x%x\n",
@@ -3670,19 +3667,13 @@ wv_pcmcia_reset(struct net_device * dev) reg.Value = reg.Value |COR_SW_RESET ; i =pcmcia_access_configuration_register (link, ®);if (i !=0 ) - { -cs_error (link, AccessConfigurationRegister, i);return FALSE; - } reg.Action =CS_WRITE ; reg.Value =COR_LEVEL_IRQ |COR_CONFIG ; i =pcmcia_access_configuration_register (link, ®);if (i !=0 ) - { -cs_error (link, AccessConfigurationRegister, i);return FALSE; - }#ifdef DEBUG_CONFIG_TRACE printk (KERN_DEBUG "%s: <-wv_pcmcia_reset()\n" , dev->name);
@@ -3857,10 +3848,7 @@ wv_pcmcia_config(struct pcmcia_device * link) { i =pcmcia_request_io (link, &link->io);if (i !=0 ) - { -cs_error (link, RequestIO, i);break ; - }/* * Now allocate an interrupt line. Note that this does not
@@ -3868,10 +3856,7 @@ wv_pcmcia_config(struct pcmcia_device * link)*/ i =pcmcia_request_irq (link, &link->irq);if (i !=0 ) - { -cs_error (link, RequestIRQ, i);break ; - }/* * This actually configures the PCMCIA socket -- setting up
@@ -3880,10 +3865,7 @@ wv_pcmcia_config(struct pcmcia_device * link) link->conf.ConfigIndex =1 ; i =pcmcia_request_configuration (link, &link->conf);if (i !=0 ) - { -cs_error (link, RequestConfiguration, i);break ; - }/* * Allocate a small memory window. Note that the struct pcmcia_device
@@ -3896,10 +3878,7 @@ wv_pcmcia_config(struct pcmcia_device * link) req.AccessSpeed = mem_speed; i =pcmcia_request_window (&link, &req, &link->win);if (i !=0 ) - { -cs_error (link, RequestWindow, i);break ; - } lp->mem =ioremap (req.Base, req.Size); dev->mem_start = (u_long )lp->mem;
@@ -3908,10 +3887,7 @@ wv_pcmcia_config(struct pcmcia_device * link) mem.CardOffset =0 ; mem.Page =0 ; i =pcmcia_map_mem_page (link->win, &mem);if (i !=0 ) - { -cs_error (link, MapMemPage, i);break ; - }/* Feed device with this info... */ dev->irq = link->irq.AssignedIRQ;
drivers/net/wireless/wl3501_cs.c +24 -43
192 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 14/16 pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
In reply to Dominik BrodowskiConvert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of PCMCIA_DEBUG.
Also, remove all usages of the CS_CHECK macro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
--- drivers/mtd/maps/pcmciamtd.c | 14 +---------- drivers/parport/parport_cs.c | 37 +++++++++++-------------------- drivers/telephony/ixj_pcmcia.c | 36 +++++++++++-------------------- drivers/usb/host/sl811_cs.c | 46 +++++++++++---------------------------- 4 files changed, 41 insertions(+), 92 deletions(-)
drivers/mtd/maps/pcmciamtd.c +2 -12
@@ -119,10 +119,8 @@ static caddr_t remap_window(struct map_info *map, unsigned long to) dev->offset, mrq.CardOffset); mrq.Page =0 ; ret =pcmcia_map_mem_page (win, &mrq); -if (ret !=0 ) { -cs_error (dev->p_dev, MapMemPage, ret); +if (ret !=0 )return NULL ; - } dev->offset = mrq.CardOffset; }return dev->win_base + (to & (dev->win_size-1 ));
@@ -327,8 +325,6 @@ static void pcmciamtd_set_vpp(struct map_info *map, int on)DEBUG (2 ,"dev = %p on = %d vpp = %d\n" , dev, on, dev->vpp); ret =pcmcia_modify_configuration (link, &mod); -if (ret !=0 ) -cs_error (link, ModifyConfiguration, ret); }
@@ -488,16 +484,12 @@ static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link,* MTD device available to the system. */ -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) -static int pcmciamtd_config (struct pcmcia_device *link) {struct pcmciamtd_dev *dev = link->priv;struct mtd_info *mtd =NULL ;cs_status_t status;win_req_t req; -int last_ret =0 , last_fn =0 ;int ret;int i;static char *probes[] = {"jedec_probe" ,"cfi_probe" };
@@ -584,7 +576,6 @@ static int pcmciamtd_config(struct pcmcia_device *link)DEBUG (2 ,"Setting Configuration" ); ret =pcmcia_request_configuration (link, &link->conf);if (ret !=0 ) { -cs_error (link, RequestConfiguration, ret);if (dev->win_base) {iounmap (dev->win_base); dev->win_base =NULL ;
@@ -659,8 +650,7 @@ static int pcmciamtd_config(struct pcmcia_device *link) link->dev_node = &dev->node;return 0 ; - cs_failed: -cs_error (link, last_fn, last_ret); + failed:err ("CS Error, exiting" );pcmciamtd_release (link);return -ENODEV ;
drivers/parport/parport_cs.c +13 -24
@@ -67,14 +67,6 @@ MODULE_LICENSE("Dual MPL/GPL");INT_MODULE_PARM (epp_mode,1 ); -#ifdef PCMCIA_DEBUG -INT_MODULE_PARM (pc_debug,PCMCIA_DEBUG ); -#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -static char *version = -"parport_cs.c 1.29 2002/10/11 06:57:41 (David Hinds)" ; -#else -#define DEBUG(n, args...) -#endif /*====================================================================*/
@@ -103,7 +95,7 @@ static int parport_probe(struct pcmcia_device *link) {parport_info_t *info; -DEBUG (0 ,"parport_attach()\n" ); +dev_dbg (&link->dev,"parport_attach()\n" );/* Create new parport device */ info =kzalloc (sizeof (*info),GFP_KERNEL );
@@ -132,7 +124,7 @@ static int parport_probe(struct pcmcia_device *link)static void parport_detach (struct pcmcia_device *link) { -DEBUG (0 ,"parport_detach(0x%p)\n" , link); +dev_dbg (&link->dev,"parport_detach\n" );parport_cs_release (link);
@@ -147,9 +139,6 @@ static void parport_detach(struct pcmcia_device *link)======================================================================*/ -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) - static int parport_config_check(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cfg, cistpl_cftable_entry_t *dflt,
@@ -178,18 +167,20 @@ static int parport_config(struct pcmcia_device *link) {parport_info_t *info = link->priv;struct parport *p; -int last_ret, last_fn; +int ret; -DEBUG (0 ,"parport_config(0x%p)\n" , link); +dev_dbg (&link->dev,"parport_config\n" ); - last_ret =pcmcia_loop_config (link, parport_config_check,NULL ); -if (last_ret) { -cs_error (link, RequestIO, last_ret); + ret =pcmcia_loop_config (link, parport_config_check,NULL ); +if (ret) goto failed; - } -CS_CHECK (RequestIRQ,pcmcia_request_irq (link, &link->irq)); -CS_CHECK (RequestConfiguration,pcmcia_request_configuration (link, &link->conf)); + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed; + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) + goto failed; p = parport_pc_probe_port(link->io.BasePort1, link->io.BasePort2, link->irq.AssignedIRQ, PARPORT_DMA_NONE,
@@ -213,8 +204,6 @@ static int parport_config(struct pcmcia_device *link)return 0 ; -cs_failed: -cs_error (link, last_fn, last_ret); failed:parport_cs_release (link);return -ENODEV ;
@@ -232,7 +221,7 @@ static void parport_cs_release(struct pcmcia_device *link) {parport_info_t *info = link->priv; -DEBUG (0 ,"parport_release(0x%p)\n" , link); +dev_dbg (&link->dev,"parport_release\n" );if (info->ndev) {struct parport *p = info->port;
drivers/telephony/ixj_pcmcia.c +13 -23
@@ -19,13 +19,6 @@* PCMCIA service support for Quicknet cards */ -#ifdef PCMCIA_DEBUG -static int pc_debug =PCMCIA_DEBUG ; -module_param (pc_debug, int,0644 ); -#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -#else -#define DEBUG(n, args...) -#endif typedef struct ixj_info_t { int ndev;
@@ -39,7 +32,7 @@ static void ixj_cs_release(struct pcmcia_device * link);static int ixj_probe (struct pcmcia_device *p_dev) { -DEBUG (0 ,"ixj_attach()\n" ); +dev_dbg (&link->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 ;
@@ -55,33 +48,30 @@ static int ixj_probe(struct pcmcia_device *p_dev)static void ixj_detach (struct pcmcia_device *link) { -DEBUG (0 ,"ixj_detach(0x%p)\n" , link); +dev_dbg (&link->dev,"ixj_detach\n" );ixj_cs_release (link);kfree (link->priv); } -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) -static void ixj_get_serial (struct pcmcia_device * link,IXJ * j) {char *str;int i, place; -DEBUG (0 ,"ixj_get_serial(0x%p)\n" , link); +dev_dbg (&link->dev,"ixj_get_serial\n" ); str = link->prod_id[0 ];if (!str) - goto cs_failed; + goto failed;printk ("%s" , str); str = link->prod_id[1 ];if (!str) - goto cs_failed; + goto failed;printk (" %s" , str); str = link->prod_id[2 ];if (!str) - goto cs_failed; + goto failed; place =1 ;for (i =strlen (str) -1 ; i >=0 ; i--) {switch (str[i]) {
@@ -118,9 +108,9 @@ static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) } str = link->prod_id[3 ];if (!str) - goto cs_failed; + goto failed;printk (" version %s\n" , str); - cs_failed: + failed:return ; }
@@ -151,13 +141,13 @@ static int ixj_config(struct pcmcia_device * link)cistpl_cftable_entry_t dflt = {0 }; info = link->priv; -DEBUG (0 ,"ixj_config(0x%p)\n" , link); +dev_dbg (&link->dev,"ixj_config\n" );if (pcmcia_loop_config (link, ixj_config_check, &dflt)) - goto cs_failed; + goto failed;if (pcmcia_request_configuration (link, &link->conf)) - goto cs_failed; + goto failed;/* * Register the card with the core.
@@ -170,7 +160,7 @@ static int ixj_config(struct pcmcia_device * link)ixj_get_serial (link, j);return 0 ; - cs_failed: + failed:ixj_cs_release (link);return -ENODEV ; }
@@ -178,7 +168,7 @@ static int ixj_config(struct pcmcia_device * link)static void ixj_cs_release (struct pcmcia_device *link) {ixj_info_t *info = link->priv; -DEBUG (0 ,"ixj_cs_release(0x%p)\n" , link); +dev_dbg (&link->dev,"ixj_cs_release\n" ); info->ndev =0 ;pcmcia_disable_device (link); }
drivers/usb/host/sl811_cs.c +13 -33
93 lines not on this page · raw message
Signature · 1 line
1.6.0.4
Re: [PATCH 11/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (scsi)
In reply to Dominik Brodowskidrivers/scsi/pcmcia/aha152x_stub.c static int aha152x_config_cs(struct pcmcia_device · line 156
Quoted 7 lines · Dominik Brodowski
drivers/scsi/pcmcia/aha152x_stub.c +1
-1@@ -164,19 +152,21 @@ static int aha152x_config_cs(struct pcmcia_device *link) {scsi_info_t *info = link->priv;struct aha152x_setup s; -int last_ret, last_fn; + int retstruct Scsi_Host *host;
This looks not even compile tested, there is a semicolon missing.
Eike
Re: [PATCH 11/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (scsi)
Quoted 11 lines · Rolf Eike Beer
Review static int aha152x_config_cs(struct pcmcia_device · line 156
Quoted 7 lines · Dominik Brodowski
(quoted diff) +1
-1@@ -164,19 +152,21 @@ static int aha152x_config_cs(struct pcmcia_device *link) { scsi_info_t *info = link->priv; struct aha152x_setup s; - int last_ret, last_fn; + int ret struct Scsi_Host *host;This looks not even compile tested, there is a semicolon missing.
Indeed, for this driver is !64BIT.... Updated patch (aha152x_stub.c only) attached.
Thanks for noticing this issue.
Dominik
drivers/scsi/pcmcia/aha152x_stub.c +15 -26
@@ -54,15 +54,6 @@#include <pcmcia/cistpl.h> #include <pcmcia/ds.h> -#ifdef PCMCIA_DEBUG -static int pc_debug =PCMCIA_DEBUG ; -module_param (pc_debug, int,0644 ); -#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -static char *version = -"aha152x_cs.c 1.54 2000/06/12 21:27:25 (David Hinds)" ; -#else -#define DEBUG(n, args...) -#endif /*====================================================================*/
@@ -103,7 +94,7 @@ static int aha152x_probe(struct pcmcia_device *link) {scsi_info_t *info; -DEBUG (0 ,"aha152x_attach()\n" ); +dev_dbg (&link->dev,"aha152x_attach()\n" );/* Create new SCSI device */ info =kzalloc (sizeof (*info),GFP_KERNEL );
@@ -127,7 +118,7 @@ static int aha152x_probe(struct pcmcia_device *link)static void aha152x_detach (struct pcmcia_device *link) { -DEBUG (0 ,"aha152x_detach(0x%p)\n" , link); +dev_dbg (&link->dev,"aha152x_detach\n" );aha152x_release_cs (link);
@@ -137,9 +128,6 @@ static void aha152x_detach(struct pcmcia_device *link)/*====================================================================*/ -#define CS_CHECK (fn, ret) \ -do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) - static int aha152x_config_check(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cfg, cistpl_cftable_entry_t *dflt,
@@ -164,19 +152,22 @@ static int aha152x_config_cs(struct pcmcia_device *link) {scsi_info_t *info = link->priv;struct aha152x_setup s; -int last_ret, last_fn; +int ret;struct Scsi_Host *host; -DEBUG (0 ,"aha152x_config(0x%p)\n" , link); +dev_dbg (&link->dev,"aha152x_config\n" ); - last_ret =pcmcia_loop_config (link, aha152x_config_check,NULL ); -if (last_ret) { -cs_error (link, RequestIO, last_ret); - goto failed; - } + ret =pcmcia_loop_config (link, aha152x_config_check,NULL ); +if (ret) + goto failed; -CS_CHECK (RequestIRQ,pcmcia_request_irq (link, &link->irq)); -CS_CHECK (RequestConfiguration,pcmcia_request_configuration (link, &link->conf)); + ret =pcmcia_request_irq (link, &link->irq); +if (ret) + goto failed; + + ret =pcmcia_request_configuration (link, &link->conf); +if (ret) + goto failed;/* Set configuration options for the aha152x driver */ memset (&s,0 ,sizeof (s));
@@ -194,7 +185,7 @@ static int aha152x_config_cs(struct pcmcia_device *link) host =aha152x_probe_one (&s);if (host ==NULL ) {printk (KERN_INFO "aha152x_cs: no SCSI devices found\n" ); - goto cs_failed; + goto failed; }sprintf (info->node.dev_name,"scsi%d" , host->host_no);
@@ -203,8 +194,6 @@ static int aha152x_config_cs(struct pcmcia_device *link)return 0 ; -cs_failed: -cs_error (link, last_fn, last_ret); failed:aha152x_release_cs (link);return -ENODEV ;
Re: [PATCH 14/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
In reply to Dominik BrodowskiQuoted 11 lines · Dominik Brodowski
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of
PCMCIA_DEBUG.Also, remove all usages of the
CS_CHECKmacro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
Have you been able to test the driver after the clean-up?
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)
Re: [PATCH 14/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
Hey,
Quoted 9 lines · Artem Bityutskiy
Quoted 8 lines · Dominik Brodowski
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of
PCMCIA_DEBUG.Also, remove all usages of the
CS_CHECKmacro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
Quoted 5 lines
Quoted 3 lines
Have you been able to test the driver after the clean-up?
No, I don't have all that much PCMCIA hardware -- and specifically none for the drivers which were modified in this patch (parport, ixj-telephony, sl811; pcmcia_mtd is marked broken anyway).
Best,
Dominik
Re: [PATCH 14/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
Quoted 16 lines · Dominik Brodowski
Hey,
Quoted 13 lines · Artem Bityutskiy
Quoted 11 lines · Dominik Brodowski
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of
PCMCIA_DEBUG.Also, remove all usages of the
CS_CHECKmacro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
Quoted 5 lines
Quoted 1 line
Have you been able to test the driver after the clean-up?
No, I don't have all that much PCMCIA hardware -- and specifically none for the drivers which were modified in this patch (parport, ixj-telephony, sl811;
pcmcia_mtdis marked broken anyway).
This driver is old and ugly, and it is even possible that no one uses it anymore, so I guess getting clean-ups without testing is ok for it. However, in that case the clean-up patches should be reviewable, which I wouldn't say about your patch :-)
Could you please split it on several smaller patches, each doing one thing only?
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)
Re: [PATCH 14/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
Quoted 6 lines · Artem Bityutskiy
Quoted 3 lines
No, I don't have all that much PCMCIA hardware -- and specifically none for the drivers which were modified in this patch (parport, ixj-telephony, sl811;
pcmcia_mtdis marked broken anyway).This driver is old and ugly, and it is even possible that no one uses it anymore, so I guess getting clean-ups without testing is ok for it.
Which one are you referring to specifically?
Quoted 2 lines
However, in that case the clean-up patches should be reviewable, which I wouldn't say about your patch :-)
It are "only" 46 line changes max per driver?
Quoted 2 lines
Could you please split it on several smaller patches, each doing one thing only?
Well, I could split up the -- related -- CS_CHECK() and dev_dbg() parts if _really_ necessary.
Best,
Dominik
Re: [PATCH 14/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
Quoted 9 lines · Dominik Brodowski
Quoted 6 lines · Artem Bityutskiy
Quoted 3 lines
No, I don't have all that much PCMCIA hardware -- and specifically none for the drivers which were modified in this patch (parport, ixj-telephony, sl811;
pcmcia_mtdis marked broken anyway).This driver is old and ugly, and it is even possible that no one uses it anymore, so I guess getting clean-ups without testing is ok for it.
Which one are you referring to specifically?
Actually I referred to pcmciamtd. I was confused a little, sorry.
Quoted 10 lines
Quoted 2 lines
However, in that case the clean-up patches should be reviewable, which I wouldn't say about your patch :-)
It are "only" 46 line changes max per driver?
Quoted 2 lines
Could you please split it on several smaller patches, each doing one thing only?
Well, I could split up the -- related --
CS_CHECK()anddev_dbg()parts if _really_ necessary.
I cannot comment about "_really_", this is just what I personally think would be a good idea, up to you.
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)
Re: [PATCH 14/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
In reply to Alan CoxQuoted 9 lines · Alan Cox
Quoted 9 lines
Quoted 3 lines
No, I don't have all that much PCMCIA hardware -- and specifically none for the drivers which were modified in this patch (parport, ixj-telephony, sl811;
pcmcia_mtdis marked broken anyway).This driver is old and ugly, and it is even possible that no one uses it anymore, so I guess getting clean-ups without testing is ok for it. However, in that case the clean-up patches should be reviewable, which I wouldn't say about your patch :-)
Quoted 5 lines
Quoted 2 lines
Could you please split it on several smaller patches, each doing one thing only?
pcmcia_mtdhas been marked broken for how long - better to delete it ? It's in the git history if anyone ever wants to resurrect it.
I do not have objections. David?
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)
Re: [PATCH 14/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
In reply to Artem BityutskiyQuoted 11 lines
Quoted 3 lines
No, I don't have all that much PCMCIA hardware -- and specifically none for the drivers which were modified in this patch (parport, ixj-telephony, sl811;
pcmcia_mtdis marked broken anyway).This driver is old and ugly, and it is even possible that no one uses it anymore, so I guess getting clean-ups without testing is ok for it. However, in that case the clean-up patches should be reviewable, which I wouldn't say about your patch :-)
Could you please split it on several smaller patches, each doing one thing only?
pcmcia_mtd has been marked broken for how long - better to delete it ? It's in the git history if anyone ever wants to resurrect it.
Re: [PATCH 04/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ide)
In reply to Dominik BrodowskiHello.
Quoted 8 lines · Dominik Brodowski
ide-cs.cis the only PCMCIA device driver making use ofCONFIG_PCMCIA_DEBUG, so convert it to use the dynamic debug infrastructure.Also, remove all usages of the
CS_CHECKmacro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.
Quoted 6 lines
Signed-off-by Dominik Brodowski <[email protected]>--- drivers/ata/pata_pcmcia.c | 16 ++++++++-------- drivers/ide/ide-cs.c | 32 +++++++++++--------------------- 2 files changed, 19 insertions(+), 29 deletions(-)
Please submit as two separate patches as ide and libata are two separate
subsystems.
WBR, Sergei
Re: [PATCH 04/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (ide)
Sergei,
Quoted 17 lines · Sergei Shtylyov
Quoted 8 lines · Dominik Brodowski
ide-cs.cis the only PCMCIA device driver making use ofCONFIG_PCMCIA_DEBUG, so convert it to use the dynamic debug infrastructure.Also, remove all usages of the
CS_CHECKmacro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.Quoted 6 lines
Signed-off-by Dominik Brodowski <[email protected]>--- drivers/ata/pata_pcmcia.c | 16 ++++++++-------- drivers/ide/ide-cs.c | 32 +++++++++++--------------------- 2 files changed, 19 insertions(+), 29 deletions(-)
Quoted 2 lines
Please submit as two separate patches as ide and libata are two
separate subsystems.
thanks for your comment. And I see your point -- but as I intend to push this upstream using the linux-pcmcia tree, as the IDE and ATA subsystems use the same (linux-ide) mailing list, and as both drivers are quire related, I thought handling both drivers in one patch is acceptable. If it still needs to be done otherwise, I'll re-submit this patch in two parts and udpate my workflow accordingly.
Best,
Dominik
Takashi Iwai
AppliedRe: [PATCH 13/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (sound)
In reply to Dominik BrodowskiAt Sat, 24 Oct 2009 21:43:03 +0200,
Quoted 4 lines · Dominik Brodowski
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of requiring manual settings of
PCMCIA_DEBUG.
Quoted 8 lines
Also, remove all usages of the
CS_CHECKmacro and replace them with proper Linux style calling and return value checking. The extra error reporting may be dropped, as the PCMCIA core already complains about any (non-driver-author) errors.CC Jaroslav Kysela <[email protected]>Signed-off-by Dominik Brodowski <[email protected]>
Thanks, applied to sound git tree now.
Takashi
Re: [PATCH 14/16] pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (misc drivers)
In reply to Artem BityutskiyQuoted 10 lines · Artem Bityutskiy
Quoted 9 lines · Alan Cox
Quoted 9 lines
Quoted 3 lines
No, I don't have all that much PCMCIA hardware -- and specifically none for the drivers which were modified in this patch (parport, ixj-telephony, sl811;
pcmcia_mtdis marked broken anyway).This driver is old and ugly, and it is even possible that no one uses it anymore, so I guess getting clean-ups without testing is ok for it. However, in that case the clean-up patches should be reviewable, which I wouldn't say about your patch :-)
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Could you please split it on several smaller patches, each doing one thing only?
pcmcia_mtdhas been marked broken for how long - better to delete it ? It's in the git history if anyone ever wants to resurrect it.I do not have objections. David?
I suggest to interpret the silence as "ok", go ahead and remove it. Dominik, do you care enough to send a patch?
Signature · 2 lines
Best Regards, Artem Bityutskiy (Артём Битюцкий)
PETEC 2MB SRAM
Hi,
this is my scenario:
Laptop: BenQ Joybook A33E
OS: OpenSuse 10.2
Kernel: 2.6.18.8-0.13-default
PCMCIA Card: PRETEC 2MB SRAM
http://pan8.fotovista.com/dev/8/6/03573268/l_03573268.jpg
pcmcia-cs version: 3.2.8
Socket: yenta-socket
IRQ: 169
After reading the Howto, mini-howto and some other stuff I still trying to figure out how to mount it and write in. Sorry if redundant but I'm a little lost. I can provide the output of some commands:
Monk:/opt/pcmcia-cs-3.2.8/cardmgr #
udevinfo -a -p /sys/bus/pcmcia/devices/0.0
Udevinfo starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1e.0/0000:01:02.0/0.0':
KERNEL=="0.0"
SUBSYSTEM=="pcmcia"
DRIVER==""
ATTR{modalias}=="pcmcia:m0000c0000f00fn00pfn00paEBF91155pb805360CApc00000000pd00000000" ATTR{prod_id2}==" 2MB SRAM CARD"
ATTR{prod_id1}=="PRETEC"
ATTR{pm_state}=="on"
ATTR{function}=="0x00"
looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:01:02.0':
KERNELS=="0000:01:02.0"
SUBSYSTEMS=="pci"
DRIVERS=="yenta_cardbus"
ATTRS{broken_parity_status}=="0"
ATTRS{enable}=="1" ATTRS{modalias}=="pci:v0000104Cd00008031sv00001071sd00008048bc06sc07i00" ATTRS{local_cpus}=="ffffffff"
ATTRS{irq}=="169"
ATTRS{class}=="0x060700"
ATTRS{subsystem_device}=="0x8048" ATTRS{subsystem_vendor}=="0x1071"
ATTRS{device}=="0x8031"
ATTRS{vendor}=="0x104c"
looking at parent device '/devices/pci0000:00/0000:00:1e.0':
KERNELS=="0000:00:1e.0"
SUBSYSTEMS=="pci"
DRIVERS==""
ATTRS{broken_parity_status}=="0"
ATTRS{enable}=="1" ATTRS{modalias}=="pci:v00008086d00002448sv00000000sd00000000bc06sc04i01" ATTRS{local_cpus}=="ffffffff"
ATTRS{irq}=="0"
ATTRS{class}=="0x060401"
ATTRS{subsystem_device}=="0x0000" ATTRS{subsystem_vendor}=="0x0000"
ATTRS{device}=="0x2448"
ATTRS{vendor}=="0x8086"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
Monk:/opt/pcmcia-cs-3.2.8/cardmgr # cat /proc/interrupts CPU0
0: 3803200 IO-APIC-edge timer
1: 44 IO-APIC-edge i8042
8: 2 IO-APIC-edge rtc
9: 22488 IO-APIC-level acpi
12: 1044 IO-APIC-edge i8042
14: 559838 IO-APIC-edge libata
15: 168263 IO-APIC-edge libata
169: 6 IO-APIC-level yenta
177: 3 IO-APIC-level uhci_hcd:usb2, ohci1394 193: 149076 IO-APIC-level uhci_hcd:usb1, ehci_hcd:usb4 201: 0 IO-APIC-level uhci_hcd:usb3
209: 865 IO-APIC-level HDA Intel
217: 3688954 IO-APIC-level eth0
NMI: 0
LOC: 3820527
ERR: 0
MIS: 0
Monk:/proc/bus/pccard # cardctl config
Socket 0:
Vcc 5.0V Vpp1 5.0V Vpp2 5.0V
Monk:/proc/bus/pccard # cardctl ident Socket 0:
product info: "PRETEC", " 2MB SRAM CARD", "", ""
But I guess that this card is not supported in /etc/pcmcia/config. More over, I can see this in /var/log/messages:
Oct 29 09:11:47 Monk cardmgr[5688]: could not adjust resource: IO ports 0x100-0x3af: Function not implemented Oct 29 09:11:47 Monk cardmgr[5688]: could not adjust resource: IO ports 0x3e0-0x4ff: Function not implemented Oct 29 09:11:47 Monk cardmgr[5688]: could not adjust resource: IO ports 0x820-0x8ff: Function not implemented Oct 29 09:11:47 Monk cardmgr[5688]: could not adjust resource: IO ports 0xc00-0xcf7: Function not implemented Oct 29 09:11:47 Monk cardmgr[5688]: could not adjust resource: memory 0xc0000-0xfffff: Function not implemented Oct 29 09:11:47 Monk cardmgr[5688]: could not adjust resource: memory 0xa0000000-0xa0ffffff: Function not implemented Oct 29 09:11:47 Monk cardmgr[5688]: could not adjust resource: memory 0x60000000-0x60ffffff: Function not implemented Oct 29 09:11:47 Monk cardmgr[5688]: could not adjust resource: IO ports 0xa00-0xaff: Function not implemented Oct 29 09:11:47 Monk cardmgr[5689]: unsupported card in socket 0 Oct 29 09:11:47 Monk cardmgr[5689]: product info: "PRETEC", " 2MB SRAM
CARD", "", ""
After see this, as you will guess, my config.opts is:
include port 0x100-0x3af
include port 0x3e0-0x4ff
include port 0x820-0x8ff
include port 0xc00-0xcf7
include memory 0xc0000-0xfffff
include memory 0xa0000000-0xa0ffffff
include memory 0x60000000-0x60ffffff
Now I'm trying to migrate from cardmgr to pcmciautils but I don't know if after migration I'll be able to make this card writable. Am I in the right way? Could someone guide me?
Thank you very much
Signature · 6 lines
Pep Talens Wincor-Nixdorf 46022 Valencia (Spain) Tel. +34 902 15 38 27 Ext. 117 [email protected]
pcmciamtd -- what's broken, who needs it?
Hey,
it seems that just as we were preparing to move pcmciamtd to staging, an user who still tries to use it has appeared:
Quoted 5 lines
ATTR{modalias}=="pcmcia:m0000c0000f00fn00pfn00paEBF91155pb805360CApc00000000pd00000000" ATTR{prod_id2}==" 2MB SRAM CARD"
ATTR{prod_id1}=="PRETEC"
ATTR{pm_state}=="on"
ATTR{function}=="0x00"
So, what is actually BROKEN with pcmciamtd.c ?
Best,
Dominik
Re: pcmciamtd -- what's broken, who needs it?
Hi,
staging directory is not the place for broken driver, is it?
Quoted 6 lines
Hey,
it seems that just as we were preparing to move pcmciamtd to staging, an user who still tries to use it has appeared:
Quoted 1 line
ATTR{modalias}=="pcmcia:m0000c0000f00fn00pfn00paEBF91155pb805360CApc0000000
0pd00000000"
Quoted 6 lines
Quoted 4 lines
? ? ATTR{prod_id2}==" ?2MB SRAM CARD"
? ? ATTR{prod_id1}=="PRETEC"
? ? ATTR{pm_state}=="on"
? ? ATTR{function}=="0x00"So, what is actually BROKEN with
pcmciamtd.c?
Best Regards
Komuro
Re: pcmciamtd -- what's broken, who needs it?
Hey,
Quoted 2 lines · Komuro
staging directory is not the place for broken driver, is it?
It is becoming the place for drivers on their way out of the kernel tree. An indication for drivers being unused is that they have been marked broken or obsolete for a loooong time; and then they'll remain in staging for 3 releases or so before being removed (or being moved in again).
Best,
Dominik
Re: pcmciamtd -- what's broken, who needs it?
Quoted 11 lines · On Sat, 7 Nov 2009 12:33:46 +0100 Dominik Brodowski…
Hey,
Quoted 2 lines · Komuro
staging directory is not the place for broken driver, is it?
It is becoming the place for drivers on their way out of the kernel tree. An indication for drivers being unused is that they have been marked broken or obsolete for a loooong time; and then they'll remain in staging for 3 releases or so before being removed (or being moved in again).
Is the 3 releases a fixed date? Got a couple of drivers in there that I "might" want to use in the near future. Just havent had time to looking at cleaning them up.
Quoted 7 lines
Best,
Dominik_______________________________________________
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Signature · 1 line
Kristoffer Ericson <[email protected]>
Re: pcmciamtd -- what's broken, who needs it?
In reply to Dominik BrodowskiHi,
At least, we need to add one line below to pcmciamtd.c .
PCMCIA_DEVICE_PROD_ID12("PRETEC", " 2MB SRAM CARD", 0xebf91155, 0x805360ca
),
Quoted 6 lines
Hey,
it seems that just as we were preparing to move pcmciamtd to staging, an user who still tries to use it has appeared:
Quoted 1 line
ATTR{modalias}=="pcmcia:m0000c0000f00fn00pfn00paEBF91155pb805360CApc0000000
0pd00000000"
Quoted 13 lines
Quoted 4 lines
? ? ATTR{prod_id2}==" ?2MB SRAM CARD"
? ? ATTR{prod_id1}=="PRETEC"
? ? ATTR{pm_state}=="on"
? ? ATTR{function}=="0x00"So, what is actually BROKEN with
pcmciamtd.c?Best,
Dominik_______________________________________________
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: pcmciamtd -- what's broken, who needs it?
In reply to Kristoffer EricsonHey,
Quoted 7 lines · Kristoffer Ericson
Quoted 5 lines · On Sat, 7 Nov 2009 12:33:46 +0100 Dominik Brodowski…
Quoted 2 lines · Komuro
staging directory is not the place for broken driver, is it?
Quoted 8 lines
Quoted 4 lines
It is becoming the place for drivers on their way out of the kernel tree. An indication for drivers being unused is that they have been marked broken or obsolete for a loooong time; and then they'll remain in staging for 3 releases or so before being removed (or being moved in again).
Is the 3 releases a fixed date? Got a couple of drivers in there that I "might" want to use in the near future. Just havent had time to looking at cleaning them up.
IIRC it's 3 releases of inaction before there's the intention to remove the drivers. But for the details of these rules (which probably aren't black and white) you should ask the maintainer of linux-staging :)
Best,
Dominik