···595595static void atmel_smooth_qual(struct atmel_private *priv);596596static void atmel_writeAR(struct net_device *dev, u16 data);597597static int probe_atmel_card(struct net_device *dev);598598-static int reset_atmel_card(struct net_device *dev );598598+static int reset_atmel_card(struct net_device *dev);599599static void atmel_enter_state(struct atmel_private *priv, int new_state);600600int atmel_open (struct net_device *dev);601601···17361736 /* Disable the key */17371737 priv->wep_key_len[index] = 0;17381738 /* Check if the key is not marked as invalid */17391739- if(!(dwrq->flags & IW_ENCODE_NOKEY)) {17391739+ if (!(dwrq->flags & IW_ENCODE_NOKEY)) {17401740 /* Cleanup */17411741 memset(priv->wep_keys[index], 0, 13);17421742 /* Copy the key in the driver */···1907190719081908 encoding->flags = idx + 1;19091909 memset(ext, 0, sizeof(*ext));19101910-19101910+19111911 if (!priv->wep_is_on) {19121912 ext->alg = IW_ENCODE_ALG_NONE;19131913 ext->key_len = 0;
+37-37
drivers/net/wireless/atmel_cs.c
···55 Copyright 2000-2001 ATMEL Corporation.66 Copyright 2003 Simon Kelley.7788- This code was developed from version 2.1.1 of the Atmel drivers, 99- released by Atmel corp. under the GPL in December 2002. It also 1010- includes code from the Linux aironet drivers (C) Benjamin Reed, 1111- and the Linux PCMCIA package, (C) David Hinds. 88+ This code was developed from version 2.1.1 of the Atmel drivers,99+ released by Atmel corp. under the GPL in December 2002. It also1010+ includes code from the Linux aironet drivers (C) Benjamin Reed,1111+ and the Linux PCMCIA package, (C) David Hinds.12121313- For all queries about this code, please contact the current author, 1313+ For all queries about this code, please contact the current author,1414 Simon Kelley <simon@thekelleys.org.uk> and not Atmel Corporation.15151616 This program is free software; you can redistribute it and/or modify···8787 event is received. The config() and release() entry points are8888 used to configure or release a socket, in response to card8989 insertion and ejection events. They are invoked from the atmel_cs9090- event handler. 9090+ event handler.9191*/92929393static int atmel_config(struct pcmcia_device *link);···133133 device IO routines can use a flag like this to throttle IO to a134134 card that is not ready to accept it.135135*/136136-136136+137137typedef struct local_info_t {138138 dev_node_t node;139139 struct net_device *eth_dev;140140} local_info_t;141141142142/*======================================================================143143-143143+144144 atmel_attach() creates an "instance" of the driver, allocating145145 local data structures for one device. The device is registered146146 with Card Services.147147-147147+148148 The dev_link structure is initialized, but we don't actually149149 configure the card at this point -- we wait until we receive a150150 card insertion event.151151-151151+152152 ======================================================================*/153153154154static int atmel_probe(struct pcmcia_device *p_dev)···184184} /* atmel_attach */185185186186/*======================================================================187187-187187+188188 This deletes a driver "instance". The device is de-registered189189 with Card Services. If it has been released, all local data190190 structures are freed. Otherwise, the structures will be freed191191 when the device is released.192192-192192+193193 ======================================================================*/194194195195static void atmel_detach(struct pcmcia_device *link)···202202}203203204204/*======================================================================205205-205205+206206 atmel_config() is scheduled to run after a CARD_INSERTION event207207 is received, to configure the PCMCIA socket, and to make the208208 device available to the system.209209-209209+210210 ======================================================================*/211211212212#define CS_CHECK(fn, ret) \···237237 did = handle_to_dev(link).driver_data;238238239239 DEBUG(0, "atmel_config(0x%p)\n", link);240240-240240+241241 tuple.Attributes = 0;242242 tuple.TupleData = buf;243243 tuple.TupleDataMax = sizeof(buf);244244 tuple.TupleOffset = 0;245245-245245+246246 /*247247 This reads the card's CONFIG tuple to find its configuration248248 registers.···258258 In this loop, we scan the CIS for configuration table entries,259259 each of which describes a valid card configuration, including260260 voltage, IO window, memory window, and interrupt settings.261261-261261+262262 We make no assumptions about the card to be configured: we use263263 just the information available in the CIS. In an ideal world,264264 this would work for any PCMCIA card, but it requires a complete···274274 if (pcmcia_get_tuple_data(link, &tuple) != 0 ||275275 pcmcia_parse_tuple(link, &tuple, &parse) != 0)276276 goto next_entry;277277-277277+278278 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;279279 if (cfg->index == 0) goto next_entry;280280 link->conf.ConfigIndex = cfg->index;281281-281281+282282 /* Does this card need audio output? */283283 if (cfg->flags & CISTPL_CFTABLE_AUDIO) {284284 link->conf.Attributes |= CONF_ENABLE_SPKR;285285 link->conf.Status = CCSR_AUDIO_ENA;286286 }287287-287287+288288 /* Use power settings for Vcc and Vpp if present */289289 /* Note that the CIS values need to be rescaled */290290 if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM))···293293 else if (dflt.vpp1.present & (1<<CISTPL_POWER_VNOM))294294 link->conf.Vpp =295295 dflt.vpp1.param[CISTPL_POWER_VNOM]/10000;296296-296296+297297 /* Do we need to allocate an interrupt? */298298 if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)299299 link->conf.Attributes |= CONF_ENABLE_IRQ;300300-300300+301301 /* IO window settings */302302 link->io.NumPorts1 = link->io.NumPorts2 = 0;303303 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {···315315 link->io.NumPorts2 = io->win[1].len;316316 }317317 }318318-318318+319319 /* This reserves IO space but doesn't actually enable it */320320 if (pcmcia_request_io(link, &link->io) != 0)321321 goto next_entry;322322323323 /* If we got this far, we're cool! */324324 break;325325-325325+326326 next_entry:327327 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));328328 }329329-329329+330330 /*331331 Allocate an interrupt line. Note that this does not assign a332332 handler to the interrupt, unless the 'Handler' member of the···334334 */335335 if (link->conf.Attributes & CONF_ENABLE_IRQ)336336 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));337337-337337+338338 /*339339 This actually configures the PCMCIA socket -- setting up340340 the I/O windows and the interrupt mapping, and putting the341341 card and host interface into "Memory and IO" mode.342342 */343343 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));344344-344344+345345 if (link->irq.AssignedIRQ == 0) {346346- printk(KERN_ALERT 346346+ printk(KERN_ALERT347347 "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");348348 goto cs_failed;349349 }350350-351351- ((local_info_t*)link->priv)->eth_dev = 350350+351351+ ((local_info_t*)link->priv)->eth_dev =352352 init_atmel_card(link->irq.AssignedIRQ,353353 link->io.BasePort1,354354 did ? did->driver_info : ATMEL_FW_TYPE_NONE,355355 &handle_to_dev(link),356356- card_present, 356356+ card_present,357357 link);358358- if (!((local_info_t*)link->priv)->eth_dev) 358358+ if (!((local_info_t*)link->priv)->eth_dev)359359 goto cs_failed;360360-361361-360360+361361+362362 /*363363 At this point, the dev_node_t structure(s) need to be364364 initialized and arranged in a linked list at link->dev_node.···376376}377377378378/*======================================================================379379-379379+380380 After a card is removed, atmel_release() will unregister the381381 device, and release the PCMCIA configuration. If the device is382382 still open, this will be postponed until it is closed.383383-383383+384384 ======================================================================*/385385386386static void atmel_release(struct pcmcia_device *link)···517517 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,518518 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING519519 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE520520- POSSIBILITY OF SUCH DAMAGE. 520520+ POSSIBILITY OF SUCH DAMAGE.521521*/522522523523module_init(atmel_cs_init);
+5-5
drivers/net/wireless/atmel_pci.c
···5353 const struct pci_device_id *pent)5454{5555 struct net_device *dev;5656-5656+5757 if (pci_enable_device(pdev))5858 return -ENODEV;5959-5959+6060 pci_set_master(pdev);6161-6262- dev = init_atmel_card(pdev->irq, pdev->resource[1].start, 6161+6262+ dev = init_atmel_card(pdev->irq, pdev->resource[1].start,6363 ATMEL_FW_TYPE_506,6464 &pdev->dev, NULL, NULL);6565 if (!dev)6666 return -ENODEV;6767-6767+6868 pci_set_drvdata(pdev, dev);6969 return 0;7070}