diff options
Diffstat (limited to 'drivers/s390/net/qeth_mpc.c')
-rw-r--r-- | drivers/s390/net/qeth_mpc.c | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_mpc.c b/drivers/s390/net/qeth_mpc.c index 77c83209d70e..f54fdfdbf06f 100644 --- a/drivers/s390/net/qeth_mpc.c +++ b/drivers/s390/net/qeth_mpc.c | |||
@@ -157,12 +157,113 @@ unsigned char READ_CCW[]={ | |||
157 | }; | 157 | }; |
158 | 158 | ||
159 | 159 | ||
160 | struct ipa_rc_msg { | ||
161 | enum qeth_ipa_return_codes rc; | ||
162 | char *msg; | ||
163 | }; | ||
160 | 164 | ||
165 | struct ipa_rc_msg qeth_ipa_rc_msg[] = { | ||
166 | {IPA_RC_SUCCESS, "success"}, | ||
167 | {IPA_RC_NOTSUPP, "Command not supported"}, | ||
168 | {IPA_RC_IP_TABLE_FULL, "Add Addr IP Table Full - ipv6"}, | ||
169 | {IPA_RC_UNKNOWN_ERROR, "IPA command failed - reason unknown"}, | ||
170 | {IPA_RC_UNSUPPORTED_COMMAND, "Command not supported"}, | ||
171 | {IPA_RC_DUP_IPV6_REMOTE,"ipv6 address already registered remote"}, | ||
172 | {IPA_RC_DUP_IPV6_HOME, "ipv6 address already registered"}, | ||
173 | {IPA_RC_UNREGISTERED_ADDR, "Address not registered"}, | ||
174 | {IPA_RC_NO_ID_AVAILABLE, "No identifiers available"}, | ||
175 | {IPA_RC_ID_NOT_FOUND, "Identifier not found"}, | ||
176 | {IPA_RC_INVALID_IP_VERSION, "IP version incorrect"}, | ||
177 | {IPA_RC_LAN_FRAME_MISMATCH, "LAN and frame mismatch"}, | ||
178 | {IPA_RC_L2_UNSUPPORTED_CMD, "Unsupported layer 2 command"}, | ||
179 | {IPA_RC_L2_DUP_MAC, "Duplicate MAC address"}, | ||
180 | {IPA_RC_L2_ADDR_TABLE_FULL, "Layer2 address table full"}, | ||
181 | {IPA_RC_L2_DUP_LAYER3_MAC, "Duplicate with layer 3 MAC"}, | ||
182 | {IPA_RC_L2_GMAC_NOT_FOUND, "GMAC not found"}, | ||
183 | {IPA_RC_L2_MAC_NOT_FOUND, "L2 mac address not found"}, | ||
184 | {IPA_RC_L2_INVALID_VLAN_ID, "L2 invalid vlan id"}, | ||
185 | {IPA_RC_L2_DUP_VLAN_ID, "L2 duplicate vlan id"}, | ||
186 | {IPA_RC_L2_VLAN_ID_NOT_FOUND, "L2 vlan id not found"}, | ||
187 | {IPA_RC_DATA_MISMATCH, "Data field mismatch (v4/v6 mixed)"}, | ||
188 | {IPA_RC_INVALID_MTU_SIZE, "Invalid MTU size"}, | ||
189 | {IPA_RC_INVALID_LANTYPE, "Invalid LAN type"}, | ||
190 | {IPA_RC_INVALID_LANNUM, "Invalid LAN num"}, | ||
191 | {IPA_RC_DUPLICATE_IP_ADDRESS, "Address already registered"}, | ||
192 | {IPA_RC_IP_ADDR_TABLE_FULL, "IP address table full"}, | ||
193 | {IPA_RC_LAN_PORT_STATE_ERROR, "LAN port state error"}, | ||
194 | {IPA_RC_SETIP_NO_STARTLAN, "Setip no startlan received"}, | ||
195 | {IPA_RC_SETIP_ALREADY_RECEIVED, "Setip already received"}, | ||
196 | {IPA_RC_IP_ADDR_ALREADY_USED, "IP address already in use on LAN"}, | ||
197 | {IPA_RC_MULTICAST_FULL, "No task available, multicast full"}, | ||
198 | {IPA_RC_SETIP_INVALID_VERSION, "SETIP invalid IP version"}, | ||
199 | {IPA_RC_UNSUPPORTED_SUBCMD, "Unsupported assist subcommand"}, | ||
200 | {IPA_RC_ARP_ASSIST_NO_ENABLE, "Only partial success, no enable"}, | ||
201 | {IPA_RC_PRIMARY_ALREADY_DEFINED,"Primary already defined"}, | ||
202 | {IPA_RC_SECOND_ALREADY_DEFINED, "Secondary already defined"}, | ||
203 | {IPA_RC_INVALID_SETRTG_INDICATOR,"Invalid SETRTG indicator"}, | ||
204 | {IPA_RC_MC_ADDR_ALREADY_DEFINED,"Multicast address already defined"}, | ||
205 | {IPA_RC_LAN_OFFLINE, "STRTLAN_LAN_DISABLED - LAN offline"}, | ||
206 | {IPA_RC_INVALID_IP_VERSION2, "Invalid IP version"}, | ||
207 | {IPA_RC_FFFF, "Unknown Error"} | ||
208 | }; | ||
161 | 209 | ||
162 | 210 | ||
163 | 211 | ||
212 | char * | ||
213 | qeth_get_ipa_msg(enum qeth_ipa_return_codes rc) | ||
214 | { | ||
215 | int x = 0; | ||
216 | qeth_ipa_rc_msg[sizeof(qeth_ipa_rc_msg) / | ||
217 | sizeof(struct ipa_rc_msg) - 1].rc = rc; | ||
218 | while(qeth_ipa_rc_msg[x].rc != rc) | ||
219 | x++; | ||
220 | return qeth_ipa_rc_msg[x].msg; | ||
221 | } | ||
164 | 222 | ||
165 | 223 | ||
224 | struct ipa_cmd_names { | ||
225 | enum qeth_ipa_cmds cmd; | ||
226 | char *name; | ||
227 | }; | ||
228 | |||
229 | struct ipa_cmd_names qeth_ipa_cmd_names[] = { | ||
230 | {IPA_CMD_STARTLAN, "startlan"}, | ||
231 | {IPA_CMD_STOPLAN, "stoplan"}, | ||
232 | {IPA_CMD_SETVMAC, "setvmac"}, | ||
233 | {IPA_CMD_DELVMAC, "delvmca"}, | ||
234 | {IPA_CMD_SETGMAC, "setgmac"}, | ||
235 | {IPA_CMD_DELGMAC, "delgmac"}, | ||
236 | {IPA_CMD_SETVLAN, "setvlan"}, | ||
237 | {IPA_CMD_DELVLAN, "delvlan"}, | ||
238 | {IPA_CMD_SETCCID, "setccid"}, | ||
239 | {IPA_CMD_DELCCID, "delccid"}, | ||
240 | {IPA_CMD_MODCCID, "setip"}, | ||
241 | {IPA_CMD_SETIP, "setip"}, | ||
242 | {IPA_CMD_QIPASSIST, "qipassist"}, | ||
243 | {IPA_CMD_SETASSPARMS, "setassparms"}, | ||
244 | {IPA_CMD_SETIPM, "setipm"}, | ||
245 | {IPA_CMD_DELIPM, "delipm"}, | ||
246 | {IPA_CMD_SETRTG, "setrtg"}, | ||
247 | {IPA_CMD_DELIP, "delip"}, | ||
248 | {IPA_CMD_SETADAPTERPARMS, "setadapterparms"}, | ||
249 | {IPA_CMD_SET_DIAG_ASS, "set_diag_ass"}, | ||
250 | {IPA_CMD_CREATE_ADDR, "create_addr"}, | ||
251 | {IPA_CMD_DESTROY_ADDR, "destroy_addr"}, | ||
252 | {IPA_CMD_REGISTER_LOCAL_ADDR, "register_local_addr"}, | ||
253 | {IPA_CMD_UNREGISTER_LOCAL_ADDR, "unregister_local_addr"}, | ||
254 | {IPA_CMD_UNKNOWN, "unknown"}, | ||
255 | }; | ||
166 | 256 | ||
257 | char * | ||
258 | qeth_get_ipa_cmd_name(enum qeth_ipa_cmds cmd) | ||
259 | { | ||
260 | int x = 0; | ||
261 | qeth_ipa_cmd_names[ | ||
262 | sizeof(qeth_ipa_cmd_names)/ | ||
263 | sizeof(struct ipa_cmd_names)-1].cmd = cmd; | ||
264 | while(qeth_ipa_cmd_names[x].cmd != cmd) | ||
265 | x++; | ||
266 | return qeth_ipa_cmd_names[x].name; | ||
267 | } | ||
167 | 268 | ||
168 | 269 | ||