Commit 5c877fe5 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Jeff Garzik

[PATCH] atmel: whitespace cleanup

NET: atmel: whitespace cleanup
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b4341135
...@@ -595,7 +595,7 @@ static void atmel_join_bss(struct atmel_private *priv, int bss_index); ...@@ -595,7 +595,7 @@ static void atmel_join_bss(struct atmel_private *priv, int bss_index);
static void atmel_smooth_qual(struct atmel_private *priv); static void atmel_smooth_qual(struct atmel_private *priv);
static void atmel_writeAR(struct net_device *dev, u16 data); static void atmel_writeAR(struct net_device *dev, u16 data);
static int probe_atmel_card(struct net_device *dev); static int probe_atmel_card(struct net_device *dev);
static int reset_atmel_card(struct net_device *dev ); static int reset_atmel_card(struct net_device *dev);
static void atmel_enter_state(struct atmel_private *priv, int new_state); static void atmel_enter_state(struct atmel_private *priv, int new_state);
int atmel_open (struct net_device *dev); int atmel_open (struct net_device *dev);
...@@ -1736,7 +1736,7 @@ static int atmel_set_encode(struct net_device *dev, ...@@ -1736,7 +1736,7 @@ static int atmel_set_encode(struct net_device *dev,
/* Disable the key */ /* Disable the key */
priv->wep_key_len[index] = 0; priv->wep_key_len[index] = 0;
/* Check if the key is not marked as invalid */ /* Check if the key is not marked as invalid */
if(!(dwrq->flags & IW_ENCODE_NOKEY)) { if (!(dwrq->flags & IW_ENCODE_NOKEY)) {
/* Cleanup */ /* Cleanup */
memset(priv->wep_keys[index], 0, 13); memset(priv->wep_keys[index], 0, 13);
/* Copy the key in the driver */ /* Copy the key in the driver */
...@@ -1907,7 +1907,7 @@ static int atmel_get_encodeext(struct net_device *dev, ...@@ -1907,7 +1907,7 @@ static int atmel_get_encodeext(struct net_device *dev,
encoding->flags = idx + 1; encoding->flags = idx + 1;
memset(ext, 0, sizeof(*ext)); memset(ext, 0, sizeof(*ext));
if (!priv->wep_is_on) { if (!priv->wep_is_on) {
ext->alg = IW_ENCODE_ALG_NONE; ext->alg = IW_ENCODE_ALG_NONE;
ext->key_len = 0; ext->key_len = 0;
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
Copyright 2000-2001 ATMEL Corporation. Copyright 2000-2001 ATMEL Corporation.
Copyright 2003 Simon Kelley. Copyright 2003 Simon Kelley.
This code was developed from version 2.1.1 of the Atmel drivers, This code was developed from version 2.1.1 of the Atmel drivers,
released by Atmel corp. under the GPL in December 2002. It also released by Atmel corp. under the GPL in December 2002. It also
includes code from the Linux aironet drivers (C) Benjamin Reed, includes code from the Linux aironet drivers (C) Benjamin Reed,
and the Linux PCMCIA package, (C) David Hinds. and the Linux PCMCIA package, (C) David Hinds.
For all queries about this code, please contact the current author, For all queries about this code, please contact the current author,
Simon Kelley <simon@thekelleys.org.uk> and not Atmel Corporation. Simon Kelley <simon@thekelleys.org.uk> and not Atmel Corporation.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
...@@ -87,7 +87,7 @@ MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards"); ...@@ -87,7 +87,7 @@ MODULE_SUPPORTED_DEVICE("Atmel at76c50x PCMCIA cards");
event is received. The config() and release() entry points are event is received. The config() and release() entry points are
used to configure or release a socket, in response to card used to configure or release a socket, in response to card
insertion and ejection events. They are invoked from the atmel_cs insertion and ejection events. They are invoked from the atmel_cs
event handler. event handler.
*/ */
static int atmel_config(struct pcmcia_device *link); static int atmel_config(struct pcmcia_device *link);
...@@ -133,22 +133,22 @@ static void atmel_detach(struct pcmcia_device *p_dev); ...@@ -133,22 +133,22 @@ static void atmel_detach(struct pcmcia_device *p_dev);
device IO routines can use a flag like this to throttle IO to a device IO routines can use a flag like this to throttle IO to a
card that is not ready to accept it. card that is not ready to accept it.
*/ */
typedef struct local_info_t { typedef struct local_info_t {
dev_node_t node; dev_node_t node;
struct net_device *eth_dev; struct net_device *eth_dev;
} local_info_t; } local_info_t;
/*====================================================================== /*======================================================================
atmel_attach() creates an "instance" of the driver, allocating atmel_attach() creates an "instance" of the driver, allocating
local data structures for one device. The device is registered local data structures for one device. The device is registered
with Card Services. with Card Services.
The dev_link structure is initialized, but we don't actually The dev_link structure is initialized, but we don't actually
configure the card at this point -- we wait until we receive a configure the card at this point -- we wait until we receive a
card insertion event. card insertion event.
======================================================================*/ ======================================================================*/
static int atmel_probe(struct pcmcia_device *p_dev) static int atmel_probe(struct pcmcia_device *p_dev)
...@@ -184,12 +184,12 @@ static int atmel_probe(struct pcmcia_device *p_dev) ...@@ -184,12 +184,12 @@ static int atmel_probe(struct pcmcia_device *p_dev)
} /* atmel_attach */ } /* atmel_attach */
/*====================================================================== /*======================================================================
This deletes a driver "instance". The device is de-registered This deletes a driver "instance". The device is de-registered
with Card Services. If it has been released, all local data with Card Services. If it has been released, all local data
structures are freed. Otherwise, the structures will be freed structures are freed. Otherwise, the structures will be freed
when the device is released. when the device is released.
======================================================================*/ ======================================================================*/
static void atmel_detach(struct pcmcia_device *link) static void atmel_detach(struct pcmcia_device *link)
...@@ -202,11 +202,11 @@ static void atmel_detach(struct pcmcia_device *link) ...@@ -202,11 +202,11 @@ static void atmel_detach(struct pcmcia_device *link)
} }
/*====================================================================== /*======================================================================
atmel_config() is scheduled to run after a CARD_INSERTION event atmel_config() is scheduled to run after a CARD_INSERTION event
is received, to configure the PCMCIA socket, and to make the is received, to configure the PCMCIA socket, and to make the
device available to the system. device available to the system.
======================================================================*/ ======================================================================*/
#define CS_CHECK(fn, ret) \ #define CS_CHECK(fn, ret) \
...@@ -237,12 +237,12 @@ static int atmel_config(struct pcmcia_device *link) ...@@ -237,12 +237,12 @@ static int atmel_config(struct pcmcia_device *link)
did = handle_to_dev(link).driver_data; did = handle_to_dev(link).driver_data;
DEBUG(0, "atmel_config(0x%p)\n", link); DEBUG(0, "atmel_config(0x%p)\n", link);
tuple.Attributes = 0; tuple.Attributes = 0;
tuple.TupleData = buf; tuple.TupleData = buf;
tuple.TupleDataMax = sizeof(buf); tuple.TupleDataMax = sizeof(buf);
tuple.TupleOffset = 0; tuple.TupleOffset = 0;
/* /*
This reads the card's CONFIG tuple to find its configuration This reads the card's CONFIG tuple to find its configuration
registers. registers.
...@@ -258,7 +258,7 @@ static int atmel_config(struct pcmcia_device *link) ...@@ -258,7 +258,7 @@ static int atmel_config(struct pcmcia_device *link)
In this loop, we scan the CIS for configuration table entries, In this loop, we scan the CIS for configuration table entries,
each of which describes a valid card configuration, including each of which describes a valid card configuration, including
voltage, IO window, memory window, and interrupt settings. voltage, IO window, memory window, and interrupt settings.
We make no assumptions about the card to be configured: we use We make no assumptions about the card to be configured: we use
just the information available in the CIS. In an ideal world, just the information available in the CIS. In an ideal world,
this would work for any PCMCIA card, but it requires a complete this would work for any PCMCIA card, but it requires a complete
...@@ -274,17 +274,17 @@ static int atmel_config(struct pcmcia_device *link) ...@@ -274,17 +274,17 @@ static int atmel_config(struct pcmcia_device *link)
if (pcmcia_get_tuple_data(link, &tuple) != 0 || if (pcmcia_get_tuple_data(link, &tuple) != 0 ||
pcmcia_parse_tuple(link, &tuple, &parse) != 0) pcmcia_parse_tuple(link, &tuple, &parse) != 0)
goto next_entry; goto next_entry;
if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
if (cfg->index == 0) goto next_entry; if (cfg->index == 0) goto next_entry;
link->conf.ConfigIndex = cfg->index; link->conf.ConfigIndex = cfg->index;
/* Does this card need audio output? */ /* Does this card need audio output? */
if (cfg->flags & CISTPL_CFTABLE_AUDIO) { if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
link->conf.Attributes |= CONF_ENABLE_SPKR; link->conf.Attributes |= CONF_ENABLE_SPKR;
link->conf.Status = CCSR_AUDIO_ENA; link->conf.Status = CCSR_AUDIO_ENA;
} }
/* Use power settings for Vcc and Vpp if present */ /* Use power settings for Vcc and Vpp if present */
/* Note that the CIS values need to be rescaled */ /* Note that the CIS values need to be rescaled */
if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM)) if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM))
...@@ -293,11 +293,11 @@ static int atmel_config(struct pcmcia_device *link) ...@@ -293,11 +293,11 @@ static int atmel_config(struct pcmcia_device *link)
else if (dflt.vpp1.present & (1<<CISTPL_POWER_VNOM)) else if (dflt.vpp1.present & (1<<CISTPL_POWER_VNOM))
link->conf.Vpp = link->conf.Vpp =
dflt.vpp1.param[CISTPL_POWER_VNOM]/10000; dflt.vpp1.param[CISTPL_POWER_VNOM]/10000;
/* Do we need to allocate an interrupt? */ /* Do we need to allocate an interrupt? */
if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1) if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
link->conf.Attributes |= CONF_ENABLE_IRQ; link->conf.Attributes |= CONF_ENABLE_IRQ;
/* IO window settings */ /* IO window settings */
link->io.NumPorts1 = link->io.NumPorts2 = 0; link->io.NumPorts1 = link->io.NumPorts2 = 0;
if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
...@@ -315,18 +315,18 @@ static int atmel_config(struct pcmcia_device *link) ...@@ -315,18 +315,18 @@ static int atmel_config(struct pcmcia_device *link)
link->io.NumPorts2 = io->win[1].len; link->io.NumPorts2 = io->win[1].len;
} }
} }
/* This reserves IO space but doesn't actually enable it */ /* This reserves IO space but doesn't actually enable it */
if (pcmcia_request_io(link, &link->io) != 0) if (pcmcia_request_io(link, &link->io) != 0)
goto next_entry; goto next_entry;
/* If we got this far, we're cool! */ /* If we got this far, we're cool! */
break; break;
next_entry: next_entry:
CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple));
} }
/* /*
Allocate an interrupt line. Note that this does not assign a Allocate an interrupt line. Note that this does not assign a
handler to the interrupt, unless the 'Handler' member of the handler to the interrupt, unless the 'Handler' member of the
...@@ -334,31 +334,31 @@ static int atmel_config(struct pcmcia_device *link) ...@@ -334,31 +334,31 @@ static int atmel_config(struct pcmcia_device *link)
*/ */
if (link->conf.Attributes & CONF_ENABLE_IRQ) if (link->conf.Attributes & CONF_ENABLE_IRQ)
CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
/* /*
This actually configures the PCMCIA socket -- setting up This actually configures the PCMCIA socket -- setting up
the I/O windows and the interrupt mapping, and putting the the I/O windows and the interrupt mapping, and putting the
card and host interface into "Memory and IO" mode. card and host interface into "Memory and IO" mode.
*/ */
CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
if (link->irq.AssignedIRQ == 0) { if (link->irq.AssignedIRQ == 0) {
printk(KERN_ALERT printk(KERN_ALERT
"atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config."); "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
goto cs_failed; goto cs_failed;
} }
((local_info_t*)link->priv)->eth_dev = ((local_info_t*)link->priv)->eth_dev =
init_atmel_card(link->irq.AssignedIRQ, init_atmel_card(link->irq.AssignedIRQ,
link->io.BasePort1, link->io.BasePort1,
did ? did->driver_info : ATMEL_FW_TYPE_NONE, did ? did->driver_info : ATMEL_FW_TYPE_NONE,
&handle_to_dev(link), &handle_to_dev(link),
card_present, card_present,
link); link);
if (!((local_info_t*)link->priv)->eth_dev) if (!((local_info_t*)link->priv)->eth_dev)
goto cs_failed; goto cs_failed;
/* /*
At this point, the dev_node_t structure(s) need to be At this point, the dev_node_t structure(s) need to be
initialized and arranged in a linked list at link->dev_node. initialized and arranged in a linked list at link->dev_node.
...@@ -376,11 +376,11 @@ static int atmel_config(struct pcmcia_device *link) ...@@ -376,11 +376,11 @@ static int atmel_config(struct pcmcia_device *link)
} }
/*====================================================================== /*======================================================================
After a card is removed, atmel_release() will unregister the After a card is removed, atmel_release() will unregister the
device, and release the PCMCIA configuration. If the device is device, and release the PCMCIA configuration. If the device is
still open, this will be postponed until it is closed. still open, this will be postponed until it is closed.
======================================================================*/ ======================================================================*/
static void atmel_release(struct pcmcia_device *link) static void atmel_release(struct pcmcia_device *link)
...@@ -517,7 +517,7 @@ static void atmel_cs_cleanup(void) ...@@ -517,7 +517,7 @@ static void atmel_cs_cleanup(void)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
module_init(atmel_cs_init); module_init(atmel_cs_init);
......
...@@ -53,18 +53,18 @@ static int __devinit atmel_pci_probe(struct pci_dev *pdev, ...@@ -53,18 +53,18 @@ static int __devinit atmel_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *pent) const struct pci_device_id *pent)
{ {
struct net_device *dev; struct net_device *dev;
if (pci_enable_device(pdev)) if (pci_enable_device(pdev))
return -ENODEV; return -ENODEV;
pci_set_master(pdev); pci_set_master(pdev);
dev = init_atmel_card(pdev->irq, pdev->resource[1].start, dev = init_atmel_card(pdev->irq, pdev->resource[1].start,
ATMEL_FW_TYPE_506, ATMEL_FW_TYPE_506,
&pdev->dev, NULL, NULL); &pdev->dev, NULL, NULL);
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment