diff options
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r-- | drivers/net/benet/be_cmds.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 89876ade5e33..25b6602e464c 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -1118,6 +1118,65 @@ int be_cmd_reset_function(struct be_adapter *adapter) | |||
1118 | return status; | 1118 | return status; |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | /* Uses sync mcc */ | ||
1122 | int be_cmd_set_beacon_state(struct be_adapter *adapter, u8 port_num, | ||
1123 | u8 bcn, u8 sts, u8 state) | ||
1124 | { | ||
1125 | struct be_mcc_wrb *wrb; | ||
1126 | struct be_cmd_req_enable_disable_beacon *req; | ||
1127 | int status; | ||
1128 | |||
1129 | spin_lock_bh(&adapter->mcc_lock); | ||
1130 | |||
1131 | wrb = wrb_from_mccq(adapter); | ||
1132 | req = embedded_payload(wrb); | ||
1133 | |||
1134 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); | ||
1135 | |||
1136 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, | ||
1137 | OPCODE_COMMON_ENABLE_DISABLE_BEACON, sizeof(*req)); | ||
1138 | |||
1139 | req->port_num = port_num; | ||
1140 | req->beacon_state = state; | ||
1141 | req->beacon_duration = bcn; | ||
1142 | req->status_duration = sts; | ||
1143 | |||
1144 | status = be_mcc_notify_wait(adapter); | ||
1145 | |||
1146 | spin_unlock_bh(&adapter->mcc_lock); | ||
1147 | return status; | ||
1148 | } | ||
1149 | |||
1150 | /* Uses sync mcc */ | ||
1151 | int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num, u32 *state) | ||
1152 | { | ||
1153 | struct be_mcc_wrb *wrb; | ||
1154 | struct be_cmd_req_get_beacon_state *req; | ||
1155 | int status; | ||
1156 | |||
1157 | spin_lock_bh(&adapter->mcc_lock); | ||
1158 | |||
1159 | wrb = wrb_from_mccq(adapter); | ||
1160 | req = embedded_payload(wrb); | ||
1161 | |||
1162 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); | ||
1163 | |||
1164 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, | ||
1165 | OPCODE_COMMON_GET_BEACON_STATE, sizeof(*req)); | ||
1166 | |||
1167 | req->port_num = port_num; | ||
1168 | |||
1169 | status = be_mcc_notify_wait(adapter); | ||
1170 | if (!status) { | ||
1171 | struct be_cmd_resp_get_beacon_state *resp = | ||
1172 | embedded_payload(wrb); | ||
1173 | *state = resp->beacon_state; | ||
1174 | } | ||
1175 | |||
1176 | spin_unlock_bh(&adapter->mcc_lock); | ||
1177 | return status; | ||
1178 | } | ||
1179 | |||
1121 | int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd, | 1180 | int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd, |
1122 | u32 flash_type, u32 flash_opcode, u32 buf_size) | 1181 | u32 flash_type, u32 flash_opcode, u32 buf_size) |
1123 | { | 1182 | { |