Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220956
b: refs/heads/master
c: 1e45028
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Oct 27, 2010
1 parent 6b10501 commit 6cc86cc
Show file tree
Hide file tree
Showing 164 changed files with 1,925 additions and 4,213 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: 089282fb028198169a0f62f8f833ab6d06bdbb3c
refs/heads/master: 1e450285281bdf766272c181ecd43d4f2f0711ce
18 changes: 18 additions & 0 deletions trunk/Documentation/networking/phy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ Doing it all yourself

A convenience function to print out the PHY status neatly.

int phy_clear_interrupt(struct phy_device *phydev);
int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);

Clear the PHY's interrupt, and configure which ones are allowed,
respectively. Currently only supports all on, or all off.

int phy_enable_interrupts(struct phy_device *phydev);
int phy_disable_interrupts(struct phy_device *phydev);

Functions which enable/disable PHY interrupts, clearing them
before and after, respectively.

int phy_start_interrupts(struct phy_device *phydev);
int phy_stop_interrupts(struct phy_device *phydev);

Expand All @@ -201,6 +213,12 @@ Doing it all yourself
Fills the phydev structure with up-to-date information about the current
settings in the PHY.

void phy_sanitize_settings(struct phy_device *phydev)

Resolves differences between currently desired settings, and
supported settings for the given PHY device. Does not make
the changes in the hardware, though.

int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);

Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/atm/eni.c
Original file line number Diff line number Diff line change
Expand Up @@ -1736,10 +1736,9 @@ static int __devinit eni_do_init(struct atm_dev *dev)
eprom = (base+EPROM_SIZE-sizeof(struct midway_eprom));
if (readl(&eprom->magic) != ENI155_MAGIC) {
printk("\n");
printk(KERN_ERR DEV_LABEL
"(itf %d): bad magic - expected 0x%x, got 0x%x\n",
dev->number, ENI155_MAGIC,
(unsigned)readl(&eprom->magic));
printk(KERN_ERR KERN_ERR DEV_LABEL "(itf %d): bad "
"magic - expected 0x%x, got 0x%x\n",dev->number,
ENI155_MAGIC,(unsigned) readl(&eprom->magic));
error = -EINVAL;
goto unmap;
}
Expand Down
75 changes: 67 additions & 8 deletions trunk/drivers/connector/cn_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,48 @@
#include <linux/connector.h>
#include <linux/delay.h>


/*
* This job is sent to the kevent workqueue.
* While no event is once sent to any callback, the connector workqueue
* is not created to avoid a useless waiting kernel task.
* Once the first event is received, we create this dedicated workqueue which
* is necessary because the flow of data can be high and we don't want
* to encumber keventd with that.
*/
static void cn_queue_create(struct work_struct *work)
{
struct cn_queue_dev *dev;

dev = container_of(work, struct cn_queue_dev, wq_creation);

dev->cn_queue = create_singlethread_workqueue(dev->name);
/* If we fail, we will use keventd for all following connector jobs */
WARN_ON(!dev->cn_queue);
}

/*
* Queue a data sent to a callback.
* If the connector workqueue is already created, we queue the job on it.
* Otherwise, we queue the job to kevent and queue the connector workqueue
* creation too.
*/
int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work)
{
struct cn_queue_dev *pdev = cbq->pdev;

if (likely(pdev->cn_queue))
return queue_work(pdev->cn_queue, work);

/* Don't create the connector workqueue twice */
if (atomic_inc_return(&pdev->wq_requested) == 1)
schedule_work(&pdev->wq_creation);
else
atomic_dec(&pdev->wq_requested);

return schedule_work(work);
}

void cn_queue_wrapper(struct work_struct *work)
{
struct cn_callback_entry *cbq =
Expand Down Expand Up @@ -69,7 +111,11 @@ cn_queue_alloc_callback_entry(char *name, struct cb_id *id,

static void cn_queue_free_callback(struct cn_callback_entry *cbq)
{
flush_workqueue(cbq->pdev->cn_queue);
/* The first jobs have been sent to kevent, flush them too */
flush_scheduled_work();
if (cbq->pdev->cn_queue)
flush_workqueue(cbq->pdev->cn_queue);

kfree(cbq);
}

Expand Down Expand Up @@ -147,24 +193,37 @@ struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *nls)
atomic_set(&dev->refcnt, 0);
INIT_LIST_HEAD(&dev->queue_list);
spin_lock_init(&dev->queue_lock);
init_waitqueue_head(&dev->wq_created);

dev->nls = nls;

dev->cn_queue = alloc_ordered_workqueue(dev->name, 0);
if (!dev->cn_queue) {
kfree(dev);
return NULL;
}
INIT_WORK(&dev->wq_creation, cn_queue_create);

return dev;
}

void cn_queue_free_dev(struct cn_queue_dev *dev)
{
struct cn_callback_entry *cbq, *n;
long timeout;
DEFINE_WAIT(wait);

/* Flush the first pending jobs queued on kevent */
flush_scheduled_work();

/* If the connector workqueue creation is still pending, wait for it */
prepare_to_wait(&dev->wq_created, &wait, TASK_UNINTERRUPTIBLE);
if (atomic_read(&dev->wq_requested) && !dev->cn_queue) {
timeout = schedule_timeout(HZ * 2);
if (!timeout && !dev->cn_queue)
WARN_ON(1);
}
finish_wait(&dev->wq_created, &wait);

flush_workqueue(dev->cn_queue);
destroy_workqueue(dev->cn_queue);
if (dev->cn_queue) {
flush_workqueue(dev->cn_queue);
destroy_workqueue(dev->cn_queue);
}

spin_lock_bh(&dev->queue_lock);
list_for_each_entry_safe(cbq, n, &dev->queue_list, callback_entry)
Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/connector/connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ static int cn_call_callback(struct sk_buff *skb)
__cbq->data.skb == NULL)) {
__cbq->data.skb = skb;

if (queue_work(dev->cbdev->cn_queue,
&__cbq->work))
if (queue_cn_work(__cbq, &__cbq->work))
err = 0;
else
err = -EINVAL;
Expand All @@ -149,11 +148,13 @@ static int cn_call_callback(struct sk_buff *skb)
d->callback = __cbq->data.callback;
d->free = __new_cbq;

__new_cbq->pdev = __cbq->pdev;

INIT_WORK(&__new_cbq->work,
&cn_queue_wrapper);

if (queue_work(dev->cbdev->cn_queue,
&__new_cbq->work))
if (queue_cn_work(__new_cbq,
&__new_cbq->work))
err = 0;
else {
kfree(__new_cbq);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/isdn/hardware/mISDN/mISDNinfineon.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ reset_inf(struct inf_hw *hw)
mdelay(10);
hw->ipac.isac.adf2 = 0x87;
hw->ipac.hscx[0].slot = 0x1f;
hw->ipac.hscx[1].slot = 0x23;
hw->ipac.hscx[0].slot = 0x23;
break;
case INF_GAZEL_R753:
val = inl((u32)hw->cfg.start + GAZEL_CNTRL);
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/isdn/hisax/l3_1tr6.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg)
char tmp[80];
struct sk_buff *skb = arg;

p = skb->data;

/* Channel Identification */
p = findie(skb->data, skb->len, WE0_chanID, 0);
if (p) {
p = skb->data;
if ((p = findie(p, skb->len, WE0_chanID, 0))) {
if (p[1] != 1) {
l3_1tr6_error(pc, "setup wrong chanID len", skb);
return;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2520,7 +2520,6 @@ source "drivers/net/stmmac/Kconfig"
config PCH_GBE
tristate "PCH Gigabit Ethernet"
depends on PCI
select MII
---help---
This is a gigabit ethernet driver for Topcliff PCH.
Topcliff PCH is the platform controller hub that is used in Intel's
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/atarilance.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static noinline int __init addr_accessible(volatile void *regp, int wordflag,
int writeflag)
{
int ret;
unsigned long flags;
long flags;
long *vbr, save_berr;

local_irq_save(flags);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/atl1c/atl1c.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ struct atl1c_adapter {
extern char atl1c_driver_name[];
extern char atl1c_driver_version[];

extern int atl1c_up(struct atl1c_adapter *adapter);
extern void atl1c_down(struct atl1c_adapter *adapter);
extern void atl1c_reinit_locked(struct atl1c_adapter *adapter);
extern s32 atl1c_reset_hw(struct atl1c_hw *hw);
extern void atl1c_set_ethtool_ops(struct net_device *netdev);
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/net/atl1c/atl1c_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ static void atl1c_set_aspm(struct atl1c_hw *hw, bool linkup);
static void atl1c_setup_mac_ctrl(struct atl1c_adapter *adapter);
static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que,
int *work_done, int work_to_do);
static int atl1c_up(struct atl1c_adapter *adapter);
static void atl1c_down(struct atl1c_adapter *adapter);

static const u16 atl1c_pay_load_size[] = {
128, 256, 512, 1024, 2048, 4096,
Expand Down Expand Up @@ -2311,7 +2309,7 @@ static int atl1c_request_irq(struct atl1c_adapter *adapter)
return err;
}

static int atl1c_up(struct atl1c_adapter *adapter)
int atl1c_up(struct atl1c_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;
int num;
Expand Down Expand Up @@ -2353,7 +2351,7 @@ static int atl1c_up(struct atl1c_adapter *adapter)
return err;
}

static void atl1c_down(struct atl1c_adapter *adapter)
void atl1c_down(struct atl1c_adapter *adapter)
{
struct net_device *netdev = adapter->netdev;

Expand Down
12 changes: 5 additions & 7 deletions trunk/drivers/net/atlx/atl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ MODULE_VERSION(ATLX_DRIVER_VERSION);
/* Temporary hack for merging atl1 and atl2 */
#include "atlx.c"

static const struct ethtool_ops atl1_ethtool_ops;

/*
* This is the only thing that needs to be changed to adjust the
* maximum number of ports that the driver can manage.
Expand Down Expand Up @@ -355,7 +353,7 @@ static bool atl1_read_eeprom(struct atl1_hw *hw, u32 offset, u32 *p_value)
* hw - Struct containing variables accessed by shared code
* reg_addr - address of the PHY register to read
*/
static s32 atl1_read_phy_reg(struct atl1_hw *hw, u16 reg_addr, u16 *phy_data)
s32 atl1_read_phy_reg(struct atl1_hw *hw, u16 reg_addr, u16 *phy_data)
{
u32 val;
int i;
Expand Down Expand Up @@ -555,7 +553,7 @@ static s32 atl1_read_mac_addr(struct atl1_hw *hw)
* 1. calcu 32bit CRC for multicast address
* 2. reverse crc with MSB to LSB
*/
static u32 atl1_hash_mc_addr(struct atl1_hw *hw, u8 *mc_addr)
u32 atl1_hash_mc_addr(struct atl1_hw *hw, u8 *mc_addr)
{
u32 crc32, value = 0;
int i;
Expand All @@ -572,7 +570,7 @@ static u32 atl1_hash_mc_addr(struct atl1_hw *hw, u8 *mc_addr)
* hw - Struct containing variables accessed by shared code
* hash_value - Multicast address hash value
*/
static void atl1_hash_set(struct atl1_hw *hw, u32 hash_value)
void atl1_hash_set(struct atl1_hw *hw, u32 hash_value)
{
u32 hash_bit, hash_reg;
u32 mta;
Expand Down Expand Up @@ -916,7 +914,7 @@ static s32 atl1_get_speed_and_duplex(struct atl1_hw *hw, u16 *speed, u16 *duplex
return 0;
}

static void atl1_set_mac_addr(struct atl1_hw *hw)
void atl1_set_mac_addr(struct atl1_hw *hw)
{
u32 value;
/*
Expand Down Expand Up @@ -3660,7 +3658,7 @@ static int atl1_nway_reset(struct net_device *netdev)
return 0;
}

static const struct ethtool_ops atl1_ethtool_ops = {
const struct ethtool_ops atl1_ethtool_ops = {
.get_settings = atl1_get_settings,
.set_settings = atl1_set_settings,
.get_drvinfo = atl1_get_drvinfo,
Expand Down
9 changes: 6 additions & 3 deletions trunk/drivers/net/atlx/atl1.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ struct atl1_adapter;
struct atl1_hw;

/* function prototypes needed by multiple files */
static u32 atl1_hash_mc_addr(struct atl1_hw *hw, u8 *mc_addr);
static void atl1_hash_set(struct atl1_hw *hw, u32 hash_value);
static void atl1_set_mac_addr(struct atl1_hw *hw);
u32 atl1_hash_mc_addr(struct atl1_hw *hw, u8 *mc_addr);
void atl1_hash_set(struct atl1_hw *hw, u32 hash_value);
s32 atl1_read_phy_reg(struct atl1_hw *hw, u16 reg_addr, u16 *phy_data);
void atl1_set_mac_addr(struct atl1_hw *hw);
static int atl1_mii_ioctl(struct net_device *netdev, struct ifreq *ifr,
int cmd);
static u32 atl1_check_link(struct atl1_adapter *adapter);

extern const struct ethtool_ops atl1_ethtool_ops;

/* hardware definitions specific to L1 */

/* Block IDLE Status Register */
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/net/atlx/atlx.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@

#include "atlx.h"

static s32 atlx_read_phy_reg(struct atl1_hw *hw, u16 reg_addr, u16 *phy_data);
static u32 atlx_hash_mc_addr(struct atl1_hw *hw, u8 *mc_addr);
static void atlx_set_mac_addr(struct atl1_hw *hw);

static struct atlx_spi_flash_dev flash_table[] = {
/* MFR_NAME WRSR READ PRGM WREN WRDI RDSR RDID SEC_ERS CHIP_ERS */
{"Atmel", 0x00, 0x03, 0x02, 0x06, 0x04, 0x05, 0x15, 0x52, 0x62},
Expand Down
36 changes: 36 additions & 0 deletions trunk/drivers/net/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,42 @@ int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num, u32 *state)
return status;
}

/* Uses sync mcc */
int be_cmd_read_port_type(struct be_adapter *adapter, u32 port,
u8 *connector)
{
struct be_mcc_wrb *wrb;
struct be_cmd_req_port_type *req;
int status;

spin_lock_bh(&adapter->mcc_lock);

wrb = wrb_from_mccq(adapter);
if (!wrb) {
status = -EBUSY;
goto err;
}
req = embedded_payload(wrb);

be_wrb_hdr_prepare(wrb, sizeof(struct be_cmd_resp_port_type), true, 0,
OPCODE_COMMON_READ_TRANSRECV_DATA);

be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_READ_TRANSRECV_DATA, sizeof(*req));

req->port = cpu_to_le32(port);
req->page_num = cpu_to_le32(TR_PAGE_A0);
status = be_mcc_notify_wait(adapter);
if (!status) {
struct be_cmd_resp_port_type *resp = embedded_payload(wrb);
*connector = resp->data.connector;
}

err:
spin_unlock_bh(&adapter->mcc_lock);
return status;
}

int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
u32 flash_type, u32 flash_opcode, u32 buf_size)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/benet/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,8 @@ extern int be_cmd_set_beacon_state(struct be_adapter *adapter,
u8 port_num, u8 beacon, u8 status, u8 state);
extern int be_cmd_get_beacon_state(struct be_adapter *adapter,
u8 port_num, u32 *state);
extern int be_cmd_read_port_type(struct be_adapter *adapter, u32 port,
u8 *connector);
extern int be_cmd_write_flashrom(struct be_adapter *adapter,
struct be_dma_mem *cmd, u32 flash_oper,
u32 flash_opcode, u32 buf_size);
Expand Down
Loading

0 comments on commit 6cc86cc

Please sign in to comment.