aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Crosser <Eugene.Crosser@ru.ibm.com>2014-01-29 03:23:48 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-29 03:43:33 -0500
commitc044dc2132d19d8c643cdd340f21afcec177c046 (patch)
tree384fa95eb06d009f68e2885d17851d38664944a7
parent6fde8f037e604e05df1529e4689041715d6d55d2 (diff)
qeth: fix build of s390 allmodconfig
commit 949efd1c "qeth: bridgeport support - basic control" broke s390 allmodconfig. This patch fixes this by eliminating one of the cross-module calls, and by making two other calls via function pointers in the qeth_discipline structure. Signed-off-by: Eugene Crosser <Eugene.Crosser@ru.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/s390/net/qeth_core.h5
-rw-r--r--drivers/s390/net/qeth_core_main.c18
-rw-r--r--drivers/s390/net/qeth_l2_main.c41
-rw-r--r--drivers/s390/net/qeth_l3_main.c8
4 files changed, 51 insertions, 21 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index ac0bdded060f..a0de045eb227 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -738,6 +738,8 @@ struct qeth_discipline {
738 int (*freeze)(struct ccwgroup_device *); 738 int (*freeze)(struct ccwgroup_device *);
739 int (*thaw) (struct ccwgroup_device *); 739 int (*thaw) (struct ccwgroup_device *);
740 int (*restore)(struct ccwgroup_device *); 740 int (*restore)(struct ccwgroup_device *);
741 int (*control_event_handler)(struct qeth_card *card,
742 struct qeth_ipa_cmd *cmd);
741}; 743};
742 744
743struct qeth_vlan_vid { 745struct qeth_vlan_vid {
@@ -948,13 +950,10 @@ int qeth_query_card_info(struct qeth_card *card,
948int qeth_send_control_data(struct qeth_card *, int, struct qeth_cmd_buffer *, 950int qeth_send_control_data(struct qeth_card *, int, struct qeth_cmd_buffer *,
949 int (*reply_cb)(struct qeth_card *, struct qeth_reply*, unsigned long), 951 int (*reply_cb)(struct qeth_card *, struct qeth_reply*, unsigned long),
950 void *reply_param); 952 void *reply_param);
951void qeth_bridge_state_change(struct qeth_card *card, struct qeth_ipa_cmd *cmd);
952void qeth_bridgeport_query_support(struct qeth_card *card);
953int qeth_bridgeport_query_ports(struct qeth_card *card, 953int qeth_bridgeport_query_ports(struct qeth_card *card,
954 enum qeth_sbp_roles *role, enum qeth_sbp_states *state); 954 enum qeth_sbp_roles *role, enum qeth_sbp_states *state);
955int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role); 955int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role);
956int qeth_bridgeport_an_set(struct qeth_card *card, int enable); 956int qeth_bridgeport_an_set(struct qeth_card *card, int enable);
957void qeth_bridge_host_event(struct qeth_card *card, struct qeth_ipa_cmd *cmd);
958int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int); 957int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int);
959int qeth_get_elements_no(struct qeth_card *, struct sk_buff *, int); 958int qeth_get_elements_no(struct qeth_card *, struct sk_buff *, int);
960int qeth_get_elements_for_frags(struct sk_buff *); 959int qeth_get_elements_for_frags(struct sk_buff *);
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index c05dacbf4e23..c3a83df07894 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -69,6 +69,7 @@ static void qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
69static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *, int); 69static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *, int);
70 70
71struct workqueue_struct *qeth_wq; 71struct workqueue_struct *qeth_wq;
72EXPORT_SYMBOL_GPL(qeth_wq);
72 73
73static void qeth_close_dev_handler(struct work_struct *work) 74static void qeth_close_dev_handler(struct work_struct *work)
74{ 75{
@@ -616,15 +617,12 @@ static struct qeth_ipa_cmd *qeth_check_ipa_data(struct qeth_card *card,
616 qeth_schedule_recovery(card); 617 qeth_schedule_recovery(card);
617 return NULL; 618 return NULL;
618 case IPA_CMD_SETBRIDGEPORT: 619 case IPA_CMD_SETBRIDGEPORT:
619 if (cmd->data.sbp.hdr.command_code ==
620 IPA_SBP_BRIDGE_PORT_STATE_CHANGE) {
621 qeth_bridge_state_change(card, cmd);
622 return NULL;
623 } else
624 return cmd;
625 case IPA_CMD_ADDRESS_CHANGE_NOTIF: 620 case IPA_CMD_ADDRESS_CHANGE_NOTIF:
626 qeth_bridge_host_event(card, cmd); 621 if (card->discipline->control_event_handler
627 return NULL; 622 (card, cmd))
623 return cmd;
624 else
625 return NULL;
628 case IPA_CMD_MODCCID: 626 case IPA_CMD_MODCCID:
629 return cmd; 627 return cmd;
630 case IPA_CMD_REGISTER_LOCAL_ADDR: 628 case IPA_CMD_REGISTER_LOCAL_ADDR:
@@ -4973,10 +4971,6 @@ retriable:
4973 qeth_query_setadapterparms(card); 4971 qeth_query_setadapterparms(card);
4974 if (qeth_adp_supported(card, IPA_SETADP_SET_DIAG_ASSIST)) 4972 if (qeth_adp_supported(card, IPA_SETADP_SET_DIAG_ASSIST))
4975 qeth_query_setdiagass(card); 4973 qeth_query_setdiagass(card);
4976 qeth_bridgeport_query_support(card);
4977 if (card->options.sbp.supported_funcs)
4978 dev_info(&card->gdev->dev,
4979 "The device represents a HiperSockets Bridge Capable Port\n");
4980 return 0; 4974 return 0;
4981out: 4975out:
4982 dev_warn(&card->gdev->dev, "The qeth device driver failed to recover " 4976 dev_warn(&card->gdev->dev, "The qeth device driver failed to recover "
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 914d2c121fd8..0710550093ce 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -33,6 +33,11 @@ static int qeth_l2_send_setdelmac(struct qeth_card *, __u8 *,
33 unsigned long)); 33 unsigned long));
34static void qeth_l2_set_multicast_list(struct net_device *); 34static void qeth_l2_set_multicast_list(struct net_device *);
35static int qeth_l2_recover(void *); 35static int qeth_l2_recover(void *);
36static void qeth_bridgeport_query_support(struct qeth_card *card);
37static void qeth_bridge_state_change(struct qeth_card *card,
38 struct qeth_ipa_cmd *cmd);
39static void qeth_bridge_host_event(struct qeth_card *card,
40 struct qeth_ipa_cmd *cmd);
36 41
37static int qeth_l2_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 42static int qeth_l2_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
38{ 43{
@@ -989,6 +994,10 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
989 rc = -ENODEV; 994 rc = -ENODEV;
990 goto out_remove; 995 goto out_remove;
991 } 996 }
997 qeth_bridgeport_query_support(card);
998 if (card->options.sbp.supported_funcs)
999 dev_info(&card->gdev->dev,
1000 "The device represents a HiperSockets Bridge Capable Port\n");
992 qeth_trace_features(card); 1001 qeth_trace_features(card);
993 1002
994 if (!card->dev && qeth_l2_setup_netdev(card)) { 1003 if (!card->dev && qeth_l2_setup_netdev(card)) {
@@ -1233,6 +1242,26 @@ out:
1233 return rc; 1242 return rc;
1234} 1243}
1235 1244
1245/* Returns zero if the command is successfully "consumed" */
1246static int qeth_l2_control_event(struct qeth_card *card,
1247 struct qeth_ipa_cmd *cmd)
1248{
1249 switch (cmd->hdr.command) {
1250 case IPA_CMD_SETBRIDGEPORT:
1251 if (cmd->data.sbp.hdr.command_code ==
1252 IPA_SBP_BRIDGE_PORT_STATE_CHANGE) {
1253 qeth_bridge_state_change(card, cmd);
1254 return 0;
1255 } else
1256 return 1;
1257 case IPA_CMD_ADDRESS_CHANGE_NOTIF:
1258 qeth_bridge_host_event(card, cmd);
1259 return 0;
1260 default:
1261 return 1;
1262 }
1263}
1264
1236struct qeth_discipline qeth_l2_discipline = { 1265struct qeth_discipline qeth_l2_discipline = {
1237 .start_poll = qeth_qdio_start_poll, 1266 .start_poll = qeth_qdio_start_poll,
1238 .input_handler = (qdio_handler_t *) qeth_qdio_input_handler, 1267 .input_handler = (qdio_handler_t *) qeth_qdio_input_handler,
@@ -1246,6 +1275,7 @@ struct qeth_discipline qeth_l2_discipline = {
1246 .freeze = qeth_l2_pm_suspend, 1275 .freeze = qeth_l2_pm_suspend,
1247 .thaw = qeth_l2_pm_resume, 1276 .thaw = qeth_l2_pm_resume,
1248 .restore = qeth_l2_pm_resume, 1277 .restore = qeth_l2_pm_resume,
1278 .control_event_handler = qeth_l2_control_event,
1249}; 1279};
1250EXPORT_SYMBOL_GPL(qeth_l2_discipline); 1280EXPORT_SYMBOL_GPL(qeth_l2_discipline);
1251 1281
@@ -1463,7 +1493,8 @@ static void qeth_bridge_state_change_worker(struct work_struct *work)
1463 kfree(data); 1493 kfree(data);
1464} 1494}
1465 1495
1466void qeth_bridge_state_change(struct qeth_card *card, struct qeth_ipa_cmd *cmd) 1496static void qeth_bridge_state_change(struct qeth_card *card,
1497 struct qeth_ipa_cmd *cmd)
1467{ 1498{
1468 struct qeth_sbp_state_change *qports = 1499 struct qeth_sbp_state_change *qports =
1469 &cmd->data.sbp.data.state_change; 1500 &cmd->data.sbp.data.state_change;
@@ -1488,7 +1519,6 @@ void qeth_bridge_state_change(struct qeth_card *card, struct qeth_ipa_cmd *cmd)
1488 sizeof(struct qeth_sbp_state_change) + extrasize); 1519 sizeof(struct qeth_sbp_state_change) + extrasize);
1489 queue_work(qeth_wq, &data->worker); 1520 queue_work(qeth_wq, &data->worker);
1490} 1521}
1491EXPORT_SYMBOL(qeth_bridge_state_change);
1492 1522
1493struct qeth_bridge_host_data { 1523struct qeth_bridge_host_data {
1494 struct work_struct worker; 1524 struct work_struct worker;
@@ -1528,7 +1558,8 @@ static void qeth_bridge_host_event_worker(struct work_struct *work)
1528 kfree(data); 1558 kfree(data);
1529} 1559}
1530 1560
1531void qeth_bridge_host_event(struct qeth_card *card, struct qeth_ipa_cmd *cmd) 1561static void qeth_bridge_host_event(struct qeth_card *card,
1562 struct qeth_ipa_cmd *cmd)
1532{ 1563{
1533 struct qeth_ipacmd_addr_change *hostevs = 1564 struct qeth_ipacmd_addr_change *hostevs =
1534 &cmd->data.addrchange; 1565 &cmd->data.addrchange;
@@ -1560,7 +1591,6 @@ void qeth_bridge_host_event(struct qeth_card *card, struct qeth_ipa_cmd *cmd)
1560 sizeof(struct qeth_ipacmd_addr_change) + extrasize); 1591 sizeof(struct qeth_ipacmd_addr_change) + extrasize);
1561 queue_work(qeth_wq, &data->worker); 1592 queue_work(qeth_wq, &data->worker);
1562} 1593}
1563EXPORT_SYMBOL(qeth_bridge_host_event);
1564 1594
1565/* SETBRIDGEPORT support; sending commands */ 1595/* SETBRIDGEPORT support; sending commands */
1566 1596
@@ -1683,7 +1713,7 @@ static int qeth_bridgeport_query_support_cb(struct qeth_card *card,
1683 * Sets bitmask of supported setbridgeport subfunctions in the qeth_card 1713 * Sets bitmask of supported setbridgeport subfunctions in the qeth_card
1684 * strucutre: card->options.sbp.supported_funcs. 1714 * strucutre: card->options.sbp.supported_funcs.
1685 */ 1715 */
1686void qeth_bridgeport_query_support(struct qeth_card *card) 1716static void qeth_bridgeport_query_support(struct qeth_card *card)
1687{ 1717{
1688 struct qeth_cmd_buffer *iob; 1718 struct qeth_cmd_buffer *iob;
1689 struct qeth_ipa_cmd *cmd; 1719 struct qeth_ipa_cmd *cmd;
@@ -1709,7 +1739,6 @@ void qeth_bridgeport_query_support(struct qeth_card *card)
1709 } 1739 }
1710 card->options.sbp.supported_funcs = cbctl.data.supported; 1740 card->options.sbp.supported_funcs = cbctl.data.supported;
1711} 1741}
1712EXPORT_SYMBOL_GPL(qeth_bridgeport_query_support);
1713 1742
1714static int qeth_bridgeport_query_ports_cb(struct qeth_card *card, 1743static int qeth_bridgeport_query_ports_cb(struct qeth_card *card,
1715 struct qeth_reply *reply, unsigned long data) 1744 struct qeth_reply *reply, unsigned long data)
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index c1b0b2761f8d..0f430424c3b8 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -3593,6 +3593,13 @@ out:
3593 return rc; 3593 return rc;
3594} 3594}
3595 3595
3596/* Returns zero if the command is successfully "consumed" */
3597static int qeth_l3_control_event(struct qeth_card *card,
3598 struct qeth_ipa_cmd *cmd)
3599{
3600 return 1;
3601}
3602
3596struct qeth_discipline qeth_l3_discipline = { 3603struct qeth_discipline qeth_l3_discipline = {
3597 .start_poll = qeth_qdio_start_poll, 3604 .start_poll = qeth_qdio_start_poll,
3598 .input_handler = (qdio_handler_t *) qeth_qdio_input_handler, 3605 .input_handler = (qdio_handler_t *) qeth_qdio_input_handler,
@@ -3606,6 +3613,7 @@ struct qeth_discipline qeth_l3_discipline = {
3606 .freeze = qeth_l3_pm_suspend, 3613 .freeze = qeth_l3_pm_suspend,
3607 .thaw = qeth_l3_pm_resume, 3614 .thaw = qeth_l3_pm_resume,
3608 .restore = qeth_l3_pm_resume, 3615 .restore = qeth_l3_pm_resume,
3616 .control_event_handler = qeth_l3_control_event,
3609}; 3617};
3610EXPORT_SYMBOL_GPL(qeth_l3_discipline); 3618EXPORT_SYMBOL_GPL(qeth_l3_discipline);
3611 3619