Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102984
b: refs/heads/master
c: caea902
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jun 17, 2008
1 parent e621f63 commit c47c967
Show file tree
Hide file tree
Showing 24 changed files with 238 additions and 167 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b4419162aa6c4204843f3a13b48d9ab821d3167
refs/heads/master: caea902f72b053fd0c76d0d3b6b2e057beb3fc64
11 changes: 9 additions & 2 deletions trunk/drivers/atm/he.c
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,8 @@ he_start(struct atm_dev *dev)
/* initialize framer */

#ifdef CONFIG_ATM_HE_USE_SUNI
suni_init(he_dev->atm_dev);
if (he_isMM(he_dev))
suni_init(he_dev->atm_dev);
if (he_dev->atm_dev->phy && he_dev->atm_dev->phy->start)
he_dev->atm_dev->phy->start(he_dev->atm_dev);
#endif /* CONFIG_ATM_HE_USE_SUNI */
Expand All @@ -1554,6 +1555,7 @@ he_start(struct atm_dev *dev)
val = he_phy_get(he_dev->atm_dev, SUNI_TPOP_APM);
val = (val & ~SUNI_TPOP_APM_S) | (SUNI_TPOP_S_SDH << SUNI_TPOP_APM_S_SHIFT);
he_phy_put(he_dev->atm_dev, val, SUNI_TPOP_APM);
he_phy_put(he_dev->atm_dev, SUNI_TACP_IUCHP_CLP, SUNI_TACP_IUCHP);
}

/* 5.1.12 enable transmit and receive */
Expand Down Expand Up @@ -2844,10 +2846,15 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void __user *arg)
if (copy_from_user(&reg, arg,
sizeof(struct he_ioctl_reg)))
return -EFAULT;

spin_lock_irqsave(&he_dev->global_lock, flags);
switch (reg.type) {
case HE_REGTYPE_PCI:
if (reg.addr < 0 || reg.addr >= HE_REGMAP_SIZE) {
err = -EINVAL;
break;
}

reg.val = he_readl(he_dev, reg.addr);
break;
case HE_REGTYPE_RCM:
Expand Down
13 changes: 4 additions & 9 deletions trunk/drivers/atm/he.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,7 @@ struct he_dev {

char prod_id[30];
char mac_addr[6];
int media; /*
* 0x26 = HE155 MM
* 0x27 = HE622 MM
* 0x46 = HE155 SM
* 0x47 = HE622 SM
*/

int media;

unsigned int vcibits, vpibits;
unsigned int cells_per_row;
Expand Down Expand Up @@ -392,6 +386,7 @@ struct he_vcc
#define HE_DEV(dev) ((struct he_dev *) (dev)->dev_data)

#define he_is622(dev) ((dev)->media & 0x1)
#define he_isMM(dev) ((dev)->media & 0x20)

#define HE_REGMAP_SIZE 0x100000

Expand Down Expand Up @@ -876,8 +871,8 @@ struct he_vcc
#define M_SN 0x3a /* integer */
#define MEDIA 0x3e /* integer */
#define HE155MM 0x26
#define HE155SM 0x27
#define HE622MM 0x46
#define HE622MM 0x27
#define HE155SM 0x46
#define HE622SM 0x47
#define MAC_ADDR 0x42 /* char[] */

Expand Down
27 changes: 13 additions & 14 deletions trunk/drivers/atm/iphase.c
Original file line number Diff line number Diff line change
Expand Up @@ -2562,17 +2562,11 @@ static int __devinit ia_start(struct atm_dev *dev)
error = suni_init(dev);
if (error)
goto err_free_rx;
/*
* Enable interrupt on loss of signal
* SUNI_RSOP_CIE - 0x10
* SUNI_RSOP_CIE_LOSE - 0x04
*/
ia_phy_put(dev, ia_phy_get(dev, 0x10) | 0x04, 0x10);
#ifndef MODULE
error = dev->phy->start(dev);
if (error)
goto err_free_rx;
#endif
if (dev->phy->start) {
error = dev->phy->start(dev);
if (error)
goto err_free_rx;
}
/* Get iadev->carrier_detect status */
IaFrontEndIntr(iadev);
}
Expand Down Expand Up @@ -3198,6 +3192,8 @@ static int __devinit ia_init_one(struct pci_dev *pdev,
IF_INIT(printk("dev_id = 0x%x iadev->LineRate = %d \n", (u32)dev,
iadev->LineRate);)

pci_set_drvdata(pdev, dev);

ia_dev[iadev_count] = iadev;
_ia_dev[iadev_count] = dev;
iadev_count++;
Expand All @@ -3219,8 +3215,6 @@ static int __devinit ia_init_one(struct pci_dev *pdev,
iadev->next_board = ia_boards;
ia_boards = dev;

pci_set_drvdata(pdev, dev);

return 0;

err_out_deregister_dev:
Expand All @@ -3238,9 +3232,14 @@ static void __devexit ia_remove_one(struct pci_dev *pdev)
struct atm_dev *dev = pci_get_drvdata(pdev);
IADEV *iadev = INPH_IA_DEV(dev);

ia_phy_put(dev, ia_phy_get(dev,0x10) & ~(0x4), 0x10);
/* Disable phy interrupts */
ia_phy_put(dev, ia_phy_get(dev, SUNI_RSOP_CIE) & ~(SUNI_RSOP_CIE_LOSE),
SUNI_RSOP_CIE);
udelay(1);

if (dev->phy && dev->phy->stop)
dev->phy->stop(dev);

/* De-register device */
free_irq(iadev->irq, dev);
iadev_count--;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/b43/b43.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ struct b43_pio {

/* Context information for a noise calculation (Link Quality). */
struct b43_noise_calculation {
u8 channel_at_start;
bool calculation_running;
u8 nr_samples;
s8 samples[8][4];
Expand Down
65 changes: 32 additions & 33 deletions trunk/drivers/net/wireless/b43/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,24 +795,49 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
{
struct b43_dmaring *ring;
int err;
int nr_slots;
dma_addr_t dma_test;

ring = kzalloc(sizeof(*ring), GFP_KERNEL);
if (!ring)
goto out;
ring->type = type;

nr_slots = B43_RXRING_SLOTS;
ring->nr_slots = B43_RXRING_SLOTS;
if (for_tx)
nr_slots = B43_TXRING_SLOTS;
ring->nr_slots = B43_TXRING_SLOTS;

ring->meta = kcalloc(nr_slots, sizeof(struct b43_dmadesc_meta),
ring->meta = kcalloc(ring->nr_slots, sizeof(struct b43_dmadesc_meta),
GFP_KERNEL);
if (!ring->meta)
goto err_kfree_ring;

ring->type = type;
ring->dev = dev;
ring->mmio_base = b43_dmacontroller_base(type, controller_index);
ring->index = controller_index;
if (type == B43_DMA_64BIT)
ring->ops = &dma64_ops;
else
ring->ops = &dma32_ops;
if (for_tx) {
ring->txhdr_cache = kcalloc(nr_slots,
ring->tx = 1;
ring->current_slot = -1;
} else {
if (ring->index == 0) {
ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE;
ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET;
} else if (ring->index == 3) {
ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE;
ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET;
} else
B43_WARN_ON(1);
}
spin_lock_init(&ring->lock);
#ifdef CONFIG_B43_DEBUG
ring->last_injected_overflow = jiffies;
#endif

if (for_tx) {
ring->txhdr_cache = kcalloc(ring->nr_slots,
b43_txhdr_size(dev),
GFP_KERNEL);
if (!ring->txhdr_cache)
Expand All @@ -828,7 +853,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
b43_txhdr_size(dev), 1)) {
/* ugh realloc */
kfree(ring->txhdr_cache);
ring->txhdr_cache = kcalloc(nr_slots,
ring->txhdr_cache = kcalloc(ring->nr_slots,
b43_txhdr_size(dev),
GFP_KERNEL | GFP_DMA);
if (!ring->txhdr_cache)
Expand All @@ -853,32 +878,6 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
DMA_TO_DEVICE);
}

ring->dev = dev;
ring->nr_slots = nr_slots;
ring->mmio_base = b43_dmacontroller_base(type, controller_index);
ring->index = controller_index;
if (type == B43_DMA_64BIT)
ring->ops = &dma64_ops;
else
ring->ops = &dma32_ops;
if (for_tx) {
ring->tx = 1;
ring->current_slot = -1;
} else {
if (ring->index == 0) {
ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE;
ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET;
} else if (ring->index == 3) {
ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE;
ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET;
} else
B43_WARN_ON(1);
}
spin_lock_init(&ring->lock);
#ifdef CONFIG_B43_DEBUG
ring->last_injected_overflow = jiffies;
#endif

err = alloc_ringmemory(ring);
if (err)
goto err_kfree_txhdr_cache;
Expand Down
16 changes: 10 additions & 6 deletions trunk/drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,6 @@ static void b43_generate_noise_sample(struct b43_wldev *dev)
b43_jssi_write(dev, 0x7F7F7F7F);
b43_write32(dev, B43_MMIO_MACCMD,
b43_read32(dev, B43_MMIO_MACCMD) | B43_MACCMD_BGNOISE);
B43_WARN_ON(dev->noisecalc.channel_at_start != dev->phy.channel);
}

static void b43_calculate_link_quality(struct b43_wldev *dev)
Expand All @@ -1154,7 +1153,6 @@ static void b43_calculate_link_quality(struct b43_wldev *dev)

if (dev->noisecalc.calculation_running)
return;
dev->noisecalc.channel_at_start = dev->phy.channel;
dev->noisecalc.calculation_running = 1;
dev->noisecalc.nr_samples = 0;

Expand All @@ -1171,9 +1169,16 @@ static void handle_irq_noise(struct b43_wldev *dev)

/* Bottom half of Link Quality calculation. */

/* Possible race condition: It might be possible that the user
* changed to a different channel in the meantime since we
* started the calculation. We ignore that fact, since it's
* not really that much of a problem. The background noise is
* an estimation only anyway. Slightly wrong results will get damped
* by the averaging of the 8 sample rounds. Additionally the
* value is shortlived. So it will be replaced by the next noise
* calculation round soon. */

B43_WARN_ON(!dev->noisecalc.calculation_running);
if (dev->noisecalc.channel_at_start != phy->channel)
goto drop_calculation;
*((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev));
if (noise[0] == 0x7F || noise[1] == 0x7F ||
noise[2] == 0x7F || noise[3] == 0x7F)
Expand Down Expand Up @@ -1214,11 +1219,10 @@ static void handle_irq_noise(struct b43_wldev *dev)
average -= 48;

dev->stats.link_noise = average;
drop_calculation:
dev->noisecalc.calculation_running = 0;
return;
}
generate_new:
generate_new:
b43_generate_noise_sample(dev);
}

Expand Down
19 changes: 10 additions & 9 deletions trunk/drivers/net/wireless/rt2x00/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ config RT2X00_LIB_FIRMWARE
config RT2X00_LIB_RFKILL
boolean
depends on RT2X00_LIB
depends on INPUT
select RFKILL
select INPUT_POLLDEV

config RT2X00_LIB_LEDS
boolean
depends on RT2X00_LIB
depends on RT2X00_LIB && NEW_LEDS

config RT2400PCI
tristate "Ralink rt2400 (PCI/PCMCIA) support"
Expand All @@ -56,7 +57,7 @@ config RT2400PCI

config RT2400PCI_RFKILL
bool "Ralink rt2400 rfkill support"
depends on RT2400PCI
depends on RT2400PCI && INPUT
select RT2X00_LIB_RFKILL
---help---
This adds support for integrated rt2400 hardware that features a
Expand All @@ -65,7 +66,7 @@ config RT2400PCI_RFKILL

config RT2400PCI_LEDS
bool "Ralink rt2400 leds support"
depends on RT2400PCI
depends on RT2400PCI && NEW_LEDS
select LEDS_CLASS
select RT2X00_LIB_LEDS
---help---
Expand All @@ -84,7 +85,7 @@ config RT2500PCI

config RT2500PCI_RFKILL
bool "Ralink rt2500 rfkill support"
depends on RT2500PCI
depends on RT2500PCI && INPUT
select RT2X00_LIB_RFKILL
---help---
This adds support for integrated rt2500 hardware that features a
Expand All @@ -93,7 +94,7 @@ config RT2500PCI_RFKILL

config RT2500PCI_LEDS
bool "Ralink rt2500 leds support"
depends on RT2500PCI
depends on RT2500PCI && NEW_LEDS
select LEDS_CLASS
select RT2X00_LIB_LEDS
---help---
Expand All @@ -114,7 +115,7 @@ config RT61PCI

config RT61PCI_RFKILL
bool "Ralink rt2501/rt61 rfkill support"
depends on RT61PCI
depends on RT61PCI && INPUT
select RT2X00_LIB_RFKILL
---help---
This adds support for integrated rt61 hardware that features a
Expand All @@ -123,7 +124,7 @@ config RT61PCI_RFKILL

config RT61PCI_LEDS
bool "Ralink rt2501/rt61 leds support"
depends on RT61PCI
depends on RT61PCI && NEW_LEDS
select LEDS_CLASS
select RT2X00_LIB_LEDS
---help---
Expand All @@ -141,7 +142,7 @@ config RT2500USB

config RT2500USB_LEDS
bool "Ralink rt2500 leds support"
depends on RT2500USB
depends on RT2500USB && NEW_LEDS
select LEDS_CLASS
select RT2X00_LIB_LEDS
---help---
Expand All @@ -161,7 +162,7 @@ config RT73USB

config RT73USB_LEDS
bool "Ralink rt2501/rt73 leds support"
depends on RT73USB
depends on RT73USB && NEW_LEDS
select LEDS_CLASS
select RT2X00_LIB_LEDS
---help---
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/rt2x00/rt2x00pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,7 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
if (pci_set_mwi(pci_dev))
ERROR_PROBE("MWI not available.\n");

if (pci_set_dma_mask(pci_dev, DMA_64BIT_MASK) &&
pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
if (pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
ERROR_PROBE("PCI DMA not supported.\n");
retval = -EIO;
goto exit_disable_device;
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/net/wireless/rt2x00/rt2x00usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,11 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev)
}

/*
* Kill guardian urb.
* Kill guardian urb (if required by driver).
*/
if (!test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))
return;

for (i = 0; i < rt2x00dev->bcn->limit; i++) {
bcn_priv = rt2x00dev->bcn->entries[i].priv_data;
if (bcn_priv->guardian_urb)
Expand Down
Loading

0 comments on commit c47c967

Please sign in to comment.