aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2009-09-05 23:22:38 -0400
committerRoland Dreier <rolandd@cisco.com>2009-09-05 23:22:38 -0400
commitfa0d4c11c4b6eb49708b82b638ceb0761152f46a (patch)
tree3e1cdc905a64d532cbf7d2fa6b58413c698f6f31 /drivers/net/cxgb3
parentb496fe82d4075847a1c42efba2e81d28f6467b3a (diff)
RDMA/cxgb3: Handle port events properly
Massage the err_handler upcall into an event handler upcall, pass netdev port events to the cxgb3 ULPs and generate RDMA port events based on LLD port events. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c6
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c6
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.h8
3 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index fb5df5c6203e..c97ab82ec743 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -1286,6 +1286,7 @@ static int cxgb_open(struct net_device *dev)
1286 if (!other_ports) 1286 if (!other_ports)
1287 schedule_chk_task(adapter); 1287 schedule_chk_task(adapter);
1288 1288
1289 cxgb3_event_notify(&adapter->tdev, OFFLOAD_PORT_UP, pi->port_id);
1289 return 0; 1290 return 0;
1290} 1291}
1291 1292
@@ -1318,6 +1319,7 @@ static int cxgb_close(struct net_device *dev)
1318 if (!adapter->open_device_map) 1319 if (!adapter->open_device_map)
1319 cxgb_down(adapter); 1320 cxgb_down(adapter);
1320 1321
1322 cxgb3_event_notify(&adapter->tdev, OFFLOAD_PORT_DOWN, pi->port_id);
1321 return 0; 1323 return 0;
1322} 1324}
1323 1325
@@ -2717,7 +2719,7 @@ static int t3_adapter_error(struct adapter *adapter, int reset)
2717 2719
2718 if (is_offload(adapter) && 2720 if (is_offload(adapter) &&
2719 test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)) { 2721 test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map)) {
2720 cxgb3_err_notify(&adapter->tdev, OFFLOAD_STATUS_DOWN, 0); 2722 cxgb3_event_notify(&adapter->tdev, OFFLOAD_STATUS_DOWN, 0);
2721 offload_close(&adapter->tdev); 2723 offload_close(&adapter->tdev);
2722 } 2724 }
2723 2725
@@ -2782,7 +2784,7 @@ static void t3_resume_ports(struct adapter *adapter)
2782 } 2784 }
2783 2785
2784 if (is_offload(adapter) && !ofld_disable) 2786 if (is_offload(adapter) && !ofld_disable)
2785 cxgb3_err_notify(&adapter->tdev, OFFLOAD_STATUS_UP, 0); 2787 cxgb3_event_notify(&adapter->tdev, OFFLOAD_STATUS_UP, 0);
2786} 2788}
2787 2789
2788/* 2790/*
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index f9f54b57b28c..75064eea1d87 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -153,14 +153,14 @@ void cxgb3_remove_clients(struct t3cdev *tdev)
153 mutex_unlock(&cxgb3_db_lock); 153 mutex_unlock(&cxgb3_db_lock);
154} 154}
155 155
156void cxgb3_err_notify(struct t3cdev *tdev, u32 status, u32 error) 156void cxgb3_event_notify(struct t3cdev *tdev, u32 event, u32 port)
157{ 157{
158 struct cxgb3_client *client; 158 struct cxgb3_client *client;
159 159
160 mutex_lock(&cxgb3_db_lock); 160 mutex_lock(&cxgb3_db_lock);
161 list_for_each_entry(client, &client_list, client_list) { 161 list_for_each_entry(client, &client_list, client_list) {
162 if (client->err_handler) 162 if (client->event_handler)
163 client->err_handler(tdev, status, error); 163 client->event_handler(tdev, event, port);
164 } 164 }
165 mutex_unlock(&cxgb3_db_lock); 165 mutex_unlock(&cxgb3_db_lock);
166} 166}
diff --git a/drivers/net/cxgb3/cxgb3_offload.h b/drivers/net/cxgb3/cxgb3_offload.h
index 55945f422aec..670aa62042da 100644
--- a/drivers/net/cxgb3/cxgb3_offload.h
+++ b/drivers/net/cxgb3/cxgb3_offload.h
@@ -64,14 +64,16 @@ void cxgb3_register_client(struct cxgb3_client *client);
64void cxgb3_unregister_client(struct cxgb3_client *client); 64void cxgb3_unregister_client(struct cxgb3_client *client);
65void cxgb3_add_clients(struct t3cdev *tdev); 65void cxgb3_add_clients(struct t3cdev *tdev);
66void cxgb3_remove_clients(struct t3cdev *tdev); 66void cxgb3_remove_clients(struct t3cdev *tdev);
67void cxgb3_err_notify(struct t3cdev *tdev, u32 status, u32 error); 67void cxgb3_event_notify(struct t3cdev *tdev, u32 event, u32 port);
68 68
69typedef int (*cxgb3_cpl_handler_func)(struct t3cdev *dev, 69typedef int (*cxgb3_cpl_handler_func)(struct t3cdev *dev,
70 struct sk_buff *skb, void *ctx); 70 struct sk_buff *skb, void *ctx);
71 71
72enum { 72enum {
73 OFFLOAD_STATUS_UP, 73 OFFLOAD_STATUS_UP,
74 OFFLOAD_STATUS_DOWN 74 OFFLOAD_STATUS_DOWN,
75 OFFLOAD_PORT_DOWN,
76 OFFLOAD_PORT_UP
75}; 77};
76 78
77struct cxgb3_client { 79struct cxgb3_client {
@@ -82,7 +84,7 @@ struct cxgb3_client {
82 int (*redirect)(void *ctx, struct dst_entry *old, 84 int (*redirect)(void *ctx, struct dst_entry *old,
83 struct dst_entry *new, struct l2t_entry *l2t); 85 struct dst_entry *new, struct l2t_entry *l2t);
84 struct list_head client_list; 86 struct list_head client_list;
85 void (*err_handler)(struct t3cdev *tdev, u32 status, u32 error); 87 void (*event_handler)(struct t3cdev *tdev, u32 event, u32 port);
86}; 88};
87 89
88/* 90/*