Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144602
b: refs/heads/master
c: a67e899
h: refs/heads/master
v: v3
  • Loading branch information
Marcel Holtmann committed May 4, 2009
1 parent 6a2ad99 commit 1d53a1d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 39 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: e151a60ad1faffb6241cf7eb6846353df1f33a32
refs/heads/master: a67e899cf38ae542d1a028ccd021f9189f76fb74
12 changes: 9 additions & 3 deletions trunk/drivers/net/bonding/bond_alb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1706,8 +1706,10 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
* Called with RTNL
*/
int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
__acquires(&bond->lock)
__releases(&bond->curr_slave_lock)
__releases(&bond->lock)
__acquires(&bond->lock)
__acquires(&bond->curr_slave_lock)
{
struct bonding *bond = netdev_priv(bond_dev);
struct sockaddr *sa = addr;
Expand Down Expand Up @@ -1743,22 +1745,26 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
}
}

write_unlock_bh(&bond->curr_slave_lock);
read_unlock(&bond->lock);

if (swap_slave) {
alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave);
alb_fasten_mac_swap(bond, swap_slave, bond->curr_active_slave);
} else {
alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr,
bond->alb_info.rlb_enabled);

read_lock(&bond->lock);
alb_send_learning_packets(bond->curr_active_slave, bond_dev->dev_addr);
if (bond->alb_info.rlb_enabled) {
/* inform clients mac address has changed */
rlb_req_update_slave_clients(bond, bond->curr_active_slave);
}
read_unlock(&bond->lock);
}

read_lock(&bond->lock);
write_lock_bh(&bond->curr_slave_lock);

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3738,7 +3738,7 @@ static irqreturn_t e1000_intr(int irq, void *data)
struct e1000_hw *hw = &adapter->hw;
u32 rctl, icr = er32(ICR);

if (unlikely((!icr) || test_bit(__E1000_DOWN, &adapter->flags)))
if (unlikely((!icr) || test_bit(__E1000_RESETTING, &adapter->flags)))
return IRQ_NONE; /* Not our interrupt */

/* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
Expand Down
1 change: 1 addition & 0 deletions trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count);

int hci_register_sysfs(struct hci_dev *hdev);
void hci_unregister_sysfs(struct hci_dev *hdev);
void hci_conn_init_sysfs(struct hci_conn *conn);
void hci_conn_add_sysfs(struct hci_conn *conn);
void hci_conn_del_sysfs(struct hci_conn *conn);

Expand Down
2 changes: 2 additions & 0 deletions trunk/net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
if (hdev->notify)
hdev->notify(hdev, HCI_NOTIFY_CONN_ADD);

hci_conn_init_sysfs(conn);

tasklet_enable(&hdev->tx_task);

return conn;
Expand Down
74 changes: 40 additions & 34 deletions trunk/net/bluetooth/hci_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
struct class *bt_class = NULL;
EXPORT_SYMBOL_GPL(bt_class);

static struct workqueue_struct *bluetooth;
static struct workqueue_struct *bt_workq;

static inline char *link_typetostr(int type)
{
Expand Down Expand Up @@ -89,36 +89,15 @@ static void add_conn(struct work_struct *work)
{
struct hci_conn *conn = container_of(work, struct hci_conn, work_add);

/* ensure previous add/del is complete */
flush_workqueue(bluetooth);
/* ensure previous del is complete */
flush_work(&conn->work_del);

if (device_add(&conn->dev) < 0) {
BT_ERR("Failed to register connection device");
return;
}
}

void hci_conn_add_sysfs(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;

BT_DBG("conn %p", conn);

conn->dev.type = &bt_link;
conn->dev.class = bt_class;
conn->dev.parent = &hdev->dev;

dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);

dev_set_drvdata(&conn->dev, conn);

device_initialize(&conn->dev);

INIT_WORK(&conn->work_add, add_conn);

queue_work(bluetooth, &conn->work_add);
}

/*
* The rfcomm tty device will possibly retain even when conn
* is down, and sysfs doesn't support move zombie device,
Expand All @@ -134,8 +113,11 @@ static void del_conn(struct work_struct *work)
struct hci_conn *conn = container_of(work, struct hci_conn, work_del);
struct hci_dev *hdev = conn->hdev;

/* ensure previous add/del is complete */
flush_workqueue(bluetooth);
/* ensure previous add is complete */
flush_work(&conn->work_add);

if (!device_is_registered(&conn->dev))
return;

while (1) {
struct device *dev;
Expand All @@ -152,16 +134,40 @@ static void del_conn(struct work_struct *work)
hci_dev_put(hdev);
}

void hci_conn_del_sysfs(struct hci_conn *conn)
void hci_conn_init_sysfs(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;

BT_DBG("conn %p", conn);

if (!device_is_registered(&conn->dev))
return;
conn->dev.type = &bt_link;
conn->dev.class = bt_class;
conn->dev.parent = &hdev->dev;

dev_set_drvdata(&conn->dev, conn);

device_initialize(&conn->dev);

INIT_WORK(&conn->work_add, add_conn);
INIT_WORK(&conn->work_del, del_conn);
}

void hci_conn_add_sysfs(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;

BT_DBG("conn %p", conn);

dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);

queue_work(bt_workq, &conn->work_add);
}

void hci_conn_del_sysfs(struct hci_conn *conn)
{
BT_DBG("conn %p", conn);

queue_work(bluetooth, &conn->work_del);
queue_work(bt_workq, &conn->work_del);
}

static inline char *host_typetostr(int type)
Expand Down Expand Up @@ -438,13 +444,13 @@ void hci_unregister_sysfs(struct hci_dev *hdev)

int __init bt_sysfs_init(void)
{
bluetooth = create_singlethread_workqueue("bluetooth");
if (!bluetooth)
bt_workq = create_singlethread_workqueue("bluetooth");
if (!bt_workq)
return -ENOMEM;

bt_class = class_create(THIS_MODULE, "bluetooth");
if (IS_ERR(bt_class)) {
destroy_workqueue(bluetooth);
destroy_workqueue(bt_workq);
return PTR_ERR(bt_class);
}

Expand All @@ -453,7 +459,7 @@ int __init bt_sysfs_init(void)

void bt_sysfs_cleanup(void)
{
destroy_workqueue(bluetooth);
destroy_workqueue(bt_workq);

class_destroy(bt_class);
}

0 comments on commit 1d53a1d

Please sign in to comment.