diff options
author | Sathya Perla <sathyap@serverengines.com> | 2009-06-17 20:10:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-19 03:18:42 -0400 |
commit | a8f447bda3ee00e3a3ab080c48db40078ea65221 (patch) | |
tree | 7b164e3dd0dee5da5229462c668c98a6297517a3 /drivers/net/benet/be_cmds.h | |
parent | 24307eef74bd38e3fc6a6df8f8a1bfc48967f9f6 (diff) |
be2net: receive asynchronous link status notifications from BE
Rcv and process ansync link status notifications from BE instead of polling
for link status in the be_worker thread.
Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_cmds.h')
-rw-r--r-- | drivers/net/benet/be_cmds.h | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index a567aa437ec9..747626da7b4e 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h | |||
@@ -76,6 +76,34 @@ struct be_mcc_cq_entry { | |||
76 | u32 flags; /* dword 3 */ | 76 | u32 flags; /* dword 3 */ |
77 | }; | 77 | }; |
78 | 78 | ||
79 | /* When the async bit of mcc_compl is set, the last 4 bytes of | ||
80 | * mcc_compl is interpreted as follows: | ||
81 | */ | ||
82 | #define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */ | ||
83 | #define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF | ||
84 | #define ASYNC_EVENT_CODE_LINK_STATE 0x1 | ||
85 | struct be_async_event_trailer { | ||
86 | u32 code; | ||
87 | }; | ||
88 | |||
89 | enum { | ||
90 | ASYNC_EVENT_LINK_DOWN = 0x0, | ||
91 | ASYNC_EVENT_LINK_UP = 0x1 | ||
92 | }; | ||
93 | |||
94 | /* When the event code of an async trailer is link-state, the mcc_compl | ||
95 | * must be interpreted as follows | ||
96 | */ | ||
97 | struct be_async_event_link_state { | ||
98 | u8 physical_port; | ||
99 | u8 port_link_status; | ||
100 | u8 port_duplex; | ||
101 | u8 port_speed; | ||
102 | u8 port_fault; | ||
103 | u8 rsvd0[7]; | ||
104 | struct be_async_event_trailer trailer; | ||
105 | } __packed; | ||
106 | |||
79 | struct be_mcc_mailbox { | 107 | struct be_mcc_mailbox { |
80 | struct be_mcc_wrb wrb; | 108 | struct be_mcc_wrb wrb; |
81 | struct be_mcc_cq_entry cqe; | 109 | struct be_mcc_cq_entry cqe; |
@@ -580,12 +608,6 @@ struct be_cmd_req_link_status { | |||
580 | u32 rsvd; | 608 | u32 rsvd; |
581 | }; | 609 | }; |
582 | 610 | ||
583 | struct be_link_info { | ||
584 | u8 duplex; | ||
585 | u8 speed; | ||
586 | u8 fault; | ||
587 | }; | ||
588 | |||
589 | enum { | 611 | enum { |
590 | PHY_LINK_DUPLEX_NONE = 0x0, | 612 | PHY_LINK_DUPLEX_NONE = 0x0, |
591 | PHY_LINK_DUPLEX_HALF = 0x1, | 613 | PHY_LINK_DUPLEX_HALF = 0x1, |
@@ -704,7 +726,7 @@ extern int be_cmd_rxq_create(struct be_ctrl_info *ctrl, | |||
704 | extern int be_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q, | 726 | extern int be_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q, |
705 | int type); | 727 | int type); |
706 | extern int be_cmd_link_status_query(struct be_ctrl_info *ctrl, | 728 | extern int be_cmd_link_status_query(struct be_ctrl_info *ctrl, |
707 | struct be_link_info *link); | 729 | bool *link_up); |
708 | extern int be_cmd_reset(struct be_ctrl_info *ctrl); | 730 | extern int be_cmd_reset(struct be_ctrl_info *ctrl); |
709 | extern int be_cmd_get_stats(struct be_ctrl_info *ctrl, | 731 | extern int be_cmd_get_stats(struct be_ctrl_info *ctrl, |
710 | struct be_dma_mem *nonemb_cmd); | 732 | struct be_dma_mem *nonemb_cmd); |