diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2012-09-24 00:24:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-24 15:45:17 -0400 |
commit | 725b9c0425f54450d1f376befb85dae706ea0c7a (patch) | |
tree | 1435ec714d406c36dc78465f6a9101b0d228dfe6 /drivers/s390 | |
parent | ae4735166ee31e29fbf8615949dac9e56299b1fd (diff) |
qeth: cleanup channel path descriptor function
Cleanup the qeth_get_channel_path_desc function and rename it
to qeth_update_from_chp_desc. No functional change.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Acked-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 74 |
1 files changed, 41 insertions, 33 deletions
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 7a8b09612c41..03848037248c 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -1257,7 +1257,30 @@ static void qeth_clean_channel(struct qeth_channel *channel) | |||
1257 | kfree(channel->iob[cnt].data); | 1257 | kfree(channel->iob[cnt].data); |
1258 | } | 1258 | } |
1259 | 1259 | ||
1260 | static void qeth_get_channel_path_desc(struct qeth_card *card) | 1260 | static void qeth_set_single_write_queues(struct qeth_card *card) |
1261 | { | ||
1262 | if ((atomic_read(&card->qdio.state) != QETH_QDIO_UNINITIALIZED) && | ||
1263 | (card->qdio.no_out_queues == 4)) | ||
1264 | qeth_free_qdio_buffers(card); | ||
1265 | |||
1266 | card->qdio.no_out_queues = 1; | ||
1267 | if (card->qdio.default_out_queue != 0) | ||
1268 | dev_info(&card->gdev->dev, "Priority Queueing not supported\n"); | ||
1269 | |||
1270 | card->qdio.default_out_queue = 0; | ||
1271 | } | ||
1272 | |||
1273 | static void qeth_set_multiple_write_queues(struct qeth_card *card) | ||
1274 | { | ||
1275 | if ((atomic_read(&card->qdio.state) != QETH_QDIO_UNINITIALIZED) && | ||
1276 | (card->qdio.no_out_queues == 1)) { | ||
1277 | qeth_free_qdio_buffers(card); | ||
1278 | card->qdio.default_out_queue = 2; | ||
1279 | } | ||
1280 | card->qdio.no_out_queues = 4; | ||
1281 | } | ||
1282 | |||
1283 | static void qeth_update_from_chp_desc(struct qeth_card *card) | ||
1261 | { | 1284 | { |
1262 | struct ccw_device *ccwdev; | 1285 | struct ccw_device *ccwdev; |
1263 | struct channelPath_dsc { | 1286 | struct channelPath_dsc { |
@@ -1274,38 +1297,23 @@ static void qeth_get_channel_path_desc(struct qeth_card *card) | |||
1274 | QETH_DBF_TEXT(SETUP, 2, "chp_desc"); | 1297 | QETH_DBF_TEXT(SETUP, 2, "chp_desc"); |
1275 | 1298 | ||
1276 | ccwdev = card->data.ccwdev; | 1299 | ccwdev = card->data.ccwdev; |
1277 | chp_dsc = (struct channelPath_dsc *)ccw_device_get_chp_desc(ccwdev, 0); | 1300 | chp_dsc = ccw_device_get_chp_desc(ccwdev, 0); |
1278 | if (chp_dsc != NULL) { | 1301 | if (!chp_dsc) |
1279 | if (card->info.type != QETH_CARD_TYPE_IQD) { | 1302 | goto out; |
1280 | /* CHPP field bit 6 == 1 -> single queue */ | 1303 | |
1281 | if ((chp_dsc->chpp & 0x02) == 0x02) { | 1304 | card->info.func_level = 0x4100 + chp_dsc->desc; |
1282 | if ((atomic_read(&card->qdio.state) != | 1305 | if (card->info.type == QETH_CARD_TYPE_IQD) |
1283 | QETH_QDIO_UNINITIALIZED) && | 1306 | goto out; |
1284 | (card->qdio.no_out_queues == 4)) | 1307 | |
1285 | /* change from 4 to 1 outbound queues */ | 1308 | /* CHPP field bit 6 == 1 -> single queue */ |
1286 | qeth_free_qdio_buffers(card); | 1309 | if ((chp_dsc->chpp & 0x02) == 0x02) |
1287 | card->qdio.no_out_queues = 1; | 1310 | qeth_set_single_write_queues(card); |
1288 | if (card->qdio.default_out_queue != 0) | 1311 | else |
1289 | dev_info(&card->gdev->dev, | 1312 | qeth_set_multiple_write_queues(card); |
1290 | "Priority Queueing not supported\n"); | 1313 | out: |
1291 | card->qdio.default_out_queue = 0; | 1314 | kfree(chp_dsc); |
1292 | } else { | ||
1293 | if ((atomic_read(&card->qdio.state) != | ||
1294 | QETH_QDIO_UNINITIALIZED) && | ||
1295 | (card->qdio.no_out_queues == 1)) { | ||
1296 | /* change from 1 to 4 outbound queues */ | ||
1297 | qeth_free_qdio_buffers(card); | ||
1298 | card->qdio.default_out_queue = 2; | ||
1299 | } | ||
1300 | card->qdio.no_out_queues = 4; | ||
1301 | } | ||
1302 | } | ||
1303 | card->info.func_level = 0x4100 + chp_dsc->desc; | ||
1304 | kfree(chp_dsc); | ||
1305 | } | ||
1306 | QETH_DBF_TEXT_(SETUP, 2, "nr:%x", card->qdio.no_out_queues); | 1315 | QETH_DBF_TEXT_(SETUP, 2, "nr:%x", card->qdio.no_out_queues); |
1307 | QETH_DBF_TEXT_(SETUP, 2, "lvl:%02x", card->info.func_level); | 1316 | QETH_DBF_TEXT_(SETUP, 2, "lvl:%02x", card->info.func_level); |
1308 | return; | ||
1309 | } | 1317 | } |
1310 | 1318 | ||
1311 | static void qeth_init_qdio_info(struct qeth_card *card) | 1319 | static void qeth_init_qdio_info(struct qeth_card *card) |
@@ -1473,7 +1481,7 @@ static int qeth_determine_card_type(struct qeth_card *card) | |||
1473 | card->qdio.no_in_queues = 1; | 1481 | card->qdio.no_in_queues = 1; |
1474 | card->info.is_multicast_different = | 1482 | card->info.is_multicast_different = |
1475 | known_devices[i][QETH_MULTICAST_IND]; | 1483 | known_devices[i][QETH_MULTICAST_IND]; |
1476 | qeth_get_channel_path_desc(card); | 1484 | qeth_update_from_chp_desc(card); |
1477 | return 0; | 1485 | return 0; |
1478 | } | 1486 | } |
1479 | i++; | 1487 | i++; |
@@ -4742,7 +4750,7 @@ int qeth_core_hardsetup_card(struct qeth_card *card) | |||
4742 | 4750 | ||
4743 | QETH_DBF_TEXT(SETUP, 2, "hrdsetup"); | 4751 | QETH_DBF_TEXT(SETUP, 2, "hrdsetup"); |
4744 | atomic_set(&card->force_alloc_skb, 0); | 4752 | atomic_set(&card->force_alloc_skb, 0); |
4745 | qeth_get_channel_path_desc(card); | 4753 | qeth_update_from_chp_desc(card); |
4746 | retry: | 4754 | retry: |
4747 | if (retries) | 4755 | if (retries) |
4748 | QETH_DBF_MESSAGE(2, "%s Retrying to do IDX activates.\n", | 4756 | QETH_DBF_MESSAGE(2, "%s Retrying to do IDX activates.\n", |