aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_cmds.c
diff options
context:
space:
mode:
authorSarveshwar Bandi <sarveshwarb@serverengines.com>2009-10-28 07:15:20 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-28 07:15:20 -0400
commit0388f251a33ea60937564ad1f27cf77243409f06 (patch)
tree1e70648214ae726e4741f2a8bbe848912ae0e0bf /drivers/net/benet/be_cmds.c
parent7e15b0c9991dfe0bf05a2f8fab9154bb7827622e (diff)
be2net: Changes to update ethtool get_settings function to return appropriate values.
Update ethtool get_settings function to: - get current link speed settings from controller - get port transceiver type from controller - fill appropriate values for supported, phy_address Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r--drivers/net/benet/be_cmds.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 827d86b5e70b..cc75dd0df0d8 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -834,7 +834,7 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
834 834
835/* Uses synchronous mcc */ 835/* Uses synchronous mcc */
836int be_cmd_link_status_query(struct be_adapter *adapter, 836int be_cmd_link_status_query(struct be_adapter *adapter,
837 bool *link_up) 837 bool *link_up, u8 *mac_speed, u16 *link_speed)
838{ 838{
839 struct be_mcc_wrb *wrb; 839 struct be_mcc_wrb *wrb;
840 struct be_cmd_req_link_status *req; 840 struct be_cmd_req_link_status *req;
@@ -855,8 +855,11 @@ int be_cmd_link_status_query(struct be_adapter *adapter,
855 status = be_mcc_notify_wait(adapter); 855 status = be_mcc_notify_wait(adapter);
856 if (!status) { 856 if (!status) {
857 struct be_cmd_resp_link_status *resp = embedded_payload(wrb); 857 struct be_cmd_resp_link_status *resp = embedded_payload(wrb);
858 if (resp->mac_speed != PHY_LINK_SPEED_ZERO) 858 if (resp->mac_speed != PHY_LINK_SPEED_ZERO) {
859 *link_up = true; 859 *link_up = true;
860 *link_speed = le16_to_cpu(resp->link_speed);
861 *mac_speed = resp->mac_speed;
862 }
860 } 863 }
861 864
862 spin_unlock_bh(&adapter->mcc_lock); 865 spin_unlock_bh(&adapter->mcc_lock);
@@ -1188,6 +1191,36 @@ int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num, u32 *state)
1188 return status; 1191 return status;
1189} 1192}
1190 1193
1194/* Uses sync mcc */
1195int be_cmd_read_port_type(struct be_adapter *adapter, u32 port,
1196 u8 *connector)
1197{
1198 struct be_mcc_wrb *wrb;
1199 struct be_cmd_req_port_type *req;
1200 int status;
1201
1202 spin_lock_bh(&adapter->mcc_lock);
1203
1204 wrb = wrb_from_mccq(adapter);
1205 req = embedded_payload(wrb);
1206
1207 be_wrb_hdr_prepare(wrb, sizeof(struct be_cmd_resp_port_type), true, 0);
1208
1209 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
1210 OPCODE_COMMON_READ_TRANSRECV_DATA, sizeof(*req));
1211
1212 req->port = cpu_to_le32(port);
1213 req->page_num = cpu_to_le32(TR_PAGE_A0);
1214 status = be_mcc_notify_wait(adapter);
1215 if (!status) {
1216 struct be_cmd_resp_port_type *resp = embedded_payload(wrb);
1217 *connector = resp->data.connector;
1218 }
1219
1220 spin_unlock_bh(&adapter->mcc_lock);
1221 return status;
1222}
1223
1191int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd, 1224int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
1192 u32 flash_type, u32 flash_opcode, u32 buf_size) 1225 u32 flash_type, u32 flash_opcode, u32 buf_size)
1193{ 1226{