Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fa0853a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NET]: rfkill: add support for input key to control wireless radio
  [NET] net/core: Fix error handling
  [TG3]: Update version and reldate.
  [TG3]: Eliminate spurious interrupts.
  [TG3]: Add ASPM workaround.
  [Bluetooth] Correct SCO buffer for another Broadcom based dongle
  [Bluetooth] Add support for Targus ACB10US USB dongle
  [Bluetooth] Disconnect L2CAP connection after last RFCOMM DLC
  [Bluetooth] Check that device is in rfcomm_dev_list before deleting
  [Bluetooth] Use in-kernel sockets API
  [Bluetooth] Attach host adapters to the Bluetooth bus
  [Bluetooth] Fix L2CAP and HCI setsockopt() information leaks
parents ef93127e cf4328cd
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -114,10 +114,16 @@ static struct usb_device_id blacklist_ids[] = {
	{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
	{ USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },

	/* Broadcom BCM2045 */
	{ USB_DEVICE(0x0a5c, 0x2101), .driver_info = HCI_WRONG_SCO_MTU },

	/* IBM/Lenovo ThinkPad with Broadcom chip */
	{ USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU },
	{ USB_DEVICE(0x0a5c, 0x2110), .driver_info = HCI_WRONG_SCO_MTU },

	/* Targus ACB10US */
	{ USB_DEVICE(0x0a5c, 0x2100), .driver_info = HCI_RESET },

	/* ANYCOM Bluetooth USB-200 and USB-250 */
	{ USB_DEVICE(0x0a5c, 0x2111), .driver_info = HCI_RESET },

+36 −4
Original line number Diff line number Diff line
@@ -64,8 +64,8 @@

#define DRV_MODULE_NAME		"tg3"
#define PFX DRV_MODULE_NAME	": "
#define DRV_MODULE_VERSION	"3.75"
#define DRV_MODULE_RELDATE	"March 23, 2007"
#define DRV_MODULE_VERSION	"3.76"
#define DRV_MODULE_RELDATE	"May 5, 2007"

#define TG3_DEF_MAC_MODE	0
#define TG3_DEF_RX_MODE		0
@@ -3019,6 +3019,16 @@ static int tg3_setup_phy(struct tg3 *tp, int force_reset)
		}
	}

	if (tp->tg3_flags & TG3_FLAG_ASPM_WORKAROUND) {
		u32 val = tr32(PCIE_PWR_MGMT_THRESH);
		if (!netif_carrier_ok(tp->dev))
			val = (val & ~PCIE_PWR_MGMT_L1_THRESH_MSK) |
			      tp->pwrmgmt_thresh;
		else
			val |= PCIE_PWR_MGMT_L1_THRESH_MSK;
		tw32(PCIE_PWR_MGMT_THRESH, val);
	}

	return err;
}

@@ -3580,8 +3590,12 @@ static irqreturn_t tg3_interrupt(int irq, void *dev_id)
	 * Writing non-zero to intr-mbox-0 additional tells the
	 * NIC to stop sending us irqs, engaging "in-intr-handler"
	 * event coalescing.
	 *
	 * Flush the mailbox to de-assert the IRQ immediately to prevent
	 * spurious interrupts.  The flush impacts performance but
	 * excessive spurious interrupts can be worse in some cases.
	 */
	tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
	tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
	if (tg3_irq_sync(tp))
		goto out;
	sblk->status &= ~SD_STATUS_UPDATED;
@@ -3625,8 +3639,12 @@ static irqreturn_t tg3_interrupt_tagged(int irq, void *dev_id)
	 * writing non-zero to intr-mbox-0 additional tells the
	 * NIC to stop sending us irqs, engaging "in-intr-handler"
	 * event coalescing.
	 *
	 * Flush the mailbox to de-assert the IRQ immediately to prevent
	 * spurious interrupts.  The flush impacts performance but
	 * excessive spurious interrupts can be worse in some cases.
	 */
	tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
	tw32_mailbox_f(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000001);
	if (tg3_irq_sync(tp))
		goto out;
	if (netif_rx_schedule_prep(dev)) {
@@ -10004,6 +10022,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
			tp->tg3_flags &= ~TG3_FLAG_EEPROM_WRITE_PROT;
			tp->tg3_flags2 |= TG3_FLG2_IS_NIC;
		}
		if (tr32(VCPU_CFGSHDW) & VCPU_CFGSHDW_ASPM_DBNC)
			tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
		return;
	}

@@ -10131,6 +10151,14 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
		/* bootcode if bit 18 is set */
		if (cfg2 & (1 << 18))
			tp->tg3_flags2 |= TG3_FLG2_SERDES_PREEMPHASIS;

		if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) {
			u32 cfg3;

			tg3_read_mem(tp, NIC_SRAM_DATA_CFG_3, &cfg3);
			if (cfg3 & NIC_SRAM_ASPM_DEBOUNCE)
				tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
		}
	}
}

@@ -10998,6 +11026,10 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
	 */
	tp->tg3_flags &= ~TG3_FLAG_WOL_ENABLE;

	if (tp->tg3_flags & TG3_FLAG_ASPM_WORKAROUND)
		tp->pwrmgmt_thresh = tr32(PCIE_PWR_MGMT_THRESH) &
				     PCIE_PWR_MGMT_L1_THRESH_MSK;

	return err;
}

+10 −0
Original line number Diff line number Diff line
@@ -1150,6 +1150,9 @@
#define  VCPU_STATUS_INIT_DONE		 0x04000000
#define  VCPU_STATUS_DRV_RESET		 0x08000000

#define VCPU_CFGSHDW			0x00005104
#define  VCPU_CFGSHDW_ASPM_DBNC		 0x00001000

/* Mailboxes */
#define GRCMBOX_BASE			0x00005600
#define GRCMBOX_INTERRUPT_0		0x00005800 /* 64-bit */
@@ -1507,6 +1510,8 @@
#define PCIE_TRANS_CFG_1SHOT_MSI	 0x20000000
#define PCIE_TRANS_CFG_LOM		 0x00000020

#define PCIE_PWR_MGMT_THRESH		0x00007d28
#define PCIE_PWR_MGMT_L1_THRESH_MSK	 0x0000ff00

#define TG3_EEPROM_MAGIC		0x669955aa
#define TG3_EEPROM_MAGIC_FW		0xa5000000
@@ -1593,6 +1598,9 @@
#define  SHASTA_EXT_LED_MAC		 0x00010000
#define  SHASTA_EXT_LED_COMBO		 0x00018000

#define NIC_SRAM_DATA_CFG_3		0x00000d3c
#define  NIC_SRAM_ASPM_DEBOUNCE		 0x00000002

#define NIC_SRAM_RX_MINI_BUFFER_DESC	0x00001000

#define NIC_SRAM_DMA_DESC_POOL_BASE	0x00002000
@@ -2200,6 +2208,7 @@ struct tg3 {
#define TG3_FLAG_USE_LINKCHG_REG	0x00000008
#define TG3_FLAG_USE_MI_INTERRUPT	0x00000010
#define TG3_FLAG_ENABLE_ASF		0x00000020
#define TG3_FLAG_ASPM_WORKAROUND	0x00000040
#define TG3_FLAG_POLL_SERDES		0x00000080
#define TG3_FLAG_MBOX_WRITE_REORDER	0x00000100
#define TG3_FLAG_PCIX_TARGET_HWBUG	0x00000200
@@ -2288,6 +2297,7 @@ struct tg3 {
	u32				grc_local_ctrl;
	u32				dma_rwctrl;
	u32				coalesce_mode;
	u32				pwrmgmt_thresh;

	/* PCI block */
	u16				pci_chip_rev_id;

include/linux/rfkill.h

0 → 100644
+89 −0
Original line number Diff line number Diff line
#ifndef __RFKILL_H
#define __RFKILL_H

/*
 * Copyright (C) 2006 Ivo van Doorn
 * Copyright (C) 2007 Dmitry Torokhov
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the
 * Free Software Foundation, Inc.,
 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/device.h>

/**
 * enum rfkill_type - type of rfkill switch.
 * RFKILL_TYPE_WLAN: switch is no a Wireless network devices.
 * RFKILL_TYPE_BlUETOOTH: switch is on a bluetooth device.
 * RFKILL_TYPE_IRDA: switch is on an infrared devices.
 */
enum rfkill_type {
	RFKILL_TYPE_WLAN = 0,
	RFKILL_TYPE_BLUETOOTH = 1,
	RFKILL_TYPE_IRDA = 2,
	RFKILL_TYPE_MAX = 3,
};

enum rfkill_state {
	RFKILL_STATE_OFF	= 0,
	RFKILL_STATE_ON		= 1,
};

/**
 * struct rfkill - rfkill control structure.
 * @name: Name of the switch.
 * @type: Radio type which the button controls, the value stored
 *	here should be a value from enum rfkill_type.
 * @state: State of the switch (on/off).
 * @user_claim: Set when the switch is controlled exlusively by userspace.
 * @mutex: Guards switch state transitions
 * @data: Pointer to the RF button drivers private data which will be
 *	passed along when toggling radio state.
 * @toggle_radio(): Mandatory handler to control state of the radio.
 * @dev: Device structure integrating the switch into device tree.
 * @node: Used to place switch into list of all switches known to the
 *	the system.
 *
 * This structure represents a RF switch located on a network device.
 */
struct rfkill {
	char *name;
	enum rfkill_type type;

	enum rfkill_state state;
	bool user_claim;

	struct mutex mutex;

	void *data;
	int (*toggle_radio)(void *data, enum rfkill_state state);

	struct device dev;
	struct list_head node;
};
#define to_rfkill(d)	container_of(d, struct rfkill, dev)

struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type);
void rfkill_free(struct rfkill *rfkill);
int rfkill_register(struct rfkill *rfkill);
void rfkill_unregister(struct rfkill *rfkill);

void rfkill_switch_all(enum rfkill_type type, enum rfkill_state state);

#endif /* RFKILL_H */
+2 −0
Original line number Diff line number Diff line
@@ -225,6 +225,8 @@ source "net/ieee80211/Kconfig"

endmenu

source "net/rfkill/Kconfig"

endif   # if NET
endmenu # Networking
Loading