diff options
author | Klaus-Dieter Wacker <kdwacker@de.ibmc.om> | 2010-07-22 19:15:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-23 15:36:22 -0400 |
commit | 6298263ac0a9aab94b399d30f67e355edc4c4f49 (patch) | |
tree | c256e72583ab1b84e9d53717cbd21f2b0dc21f4d /drivers/s390/net | |
parent | 1ff219068c0e032a6fd64c45bd69f3bc7374feb6 (diff) |
qeth: IP address takeover flag setting
The qeth IP address flag setting is possible when device is
offline. When setting device online afterwards the current set
IP addresses have to be correctly registered with the device
regarding the IP address takeover attribute.
Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r-- | drivers/s390/net/qeth_core.h | 3 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 7 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3.h | 1 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 2 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3_sys.c | 14 |
5 files changed, 18 insertions, 9 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index d79892782a2b..e7e99e6cad21 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h | |||
@@ -188,8 +188,7 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa, | |||
188 | qeth_is_enabled6(c, f) : qeth_is_enabled(c, f)) | 188 | qeth_is_enabled6(c, f) : qeth_is_enabled(c, f)) |
189 | 189 | ||
190 | #define QETH_IDX_FUNC_LEVEL_OSD 0x0101 | 190 | #define QETH_IDX_FUNC_LEVEL_OSD 0x0101 |
191 | #define QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT 0x4108 | 191 | #define QETH_IDX_FUNC_LEVEL_IQD 0x4108 |
192 | #define QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT 0x5108 | ||
193 | 192 | ||
194 | #define QETH_MODELLIST_ARRAY \ | 193 | #define QETH_MODELLIST_ARRAY \ |
195 | {{0x1731, 0x01, 0x1732, QETH_CARD_TYPE_OSD, QETH_MAX_QUEUES, 0}, \ | 194 | {{0x1731, 0x01, 0x1732, QETH_CARD_TYPE_OSD, QETH_MAX_QUEUES, 0}, \ |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index b7019066c303..844935fbe6a8 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -1383,12 +1383,7 @@ static void qeth_init_func_level(struct qeth_card *card) | |||
1383 | { | 1383 | { |
1384 | switch (card->info.type) { | 1384 | switch (card->info.type) { |
1385 | case QETH_CARD_TYPE_IQD: | 1385 | case QETH_CARD_TYPE_IQD: |
1386 | if (card->ipato.enabled) | 1386 | card->info.func_level = QETH_IDX_FUNC_LEVEL_IQD; |
1387 | card->info.func_level = | ||
1388 | QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT; | ||
1389 | else | ||
1390 | card->info.func_level = | ||
1391 | QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT; | ||
1392 | break; | 1387 | break; |
1393 | case QETH_CARD_TYPE_OSD: | 1388 | case QETH_CARD_TYPE_OSD: |
1394 | case QETH_CARD_TYPE_OSN: | 1389 | case QETH_CARD_TYPE_OSN: |
diff --git a/drivers/s390/net/qeth_l3.h b/drivers/s390/net/qeth_l3.h index 8447d233d0b3..e705b27ec7dc 100644 --- a/drivers/s390/net/qeth_l3.h +++ b/drivers/s390/net/qeth_l3.h | |||
@@ -64,5 +64,6 @@ void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions, | |||
64 | const u8 *); | 64 | const u8 *); |
65 | int qeth_l3_set_large_send(struct qeth_card *, enum qeth_large_send_types); | 65 | int qeth_l3_set_large_send(struct qeth_card *, enum qeth_large_send_types); |
66 | int qeth_l3_set_rx_csum(struct qeth_card *, enum qeth_checksum_types); | 66 | int qeth_l3_set_rx_csum(struct qeth_card *, enum qeth_checksum_types); |
67 | int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *, struct qeth_ipaddr *); | ||
67 | 68 | ||
68 | #endif /* __QETH_L3_H__ */ | 69 | #endif /* __QETH_L3_H__ */ |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 61d348e51920..15b5ca82bd26 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -195,7 +195,7 @@ static void qeth_l3_convert_addr_to_bits(u8 *addr, u8 *bits, int len) | |||
195 | } | 195 | } |
196 | } | 196 | } |
197 | 197 | ||
198 | static int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *card, | 198 | int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *card, |
199 | struct qeth_ipaddr *addr) | 199 | struct qeth_ipaddr *addr) |
200 | { | 200 | { |
201 | struct qeth_ipato_entry *ipatoe; | 201 | struct qeth_ipato_entry *ipatoe; |
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c index fb5318b30e99..67cfa68dcf1b 100644 --- a/drivers/s390/net/qeth_l3_sys.c +++ b/drivers/s390/net/qeth_l3_sys.c | |||
@@ -479,6 +479,7 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev, | |||
479 | struct device_attribute *attr, const char *buf, size_t count) | 479 | struct device_attribute *attr, const char *buf, size_t count) |
480 | { | 480 | { |
481 | struct qeth_card *card = dev_get_drvdata(dev); | 481 | struct qeth_card *card = dev_get_drvdata(dev); |
482 | struct qeth_ipaddr *tmpipa, *t; | ||
482 | char *tmp; | 483 | char *tmp; |
483 | int rc = 0; | 484 | int rc = 0; |
484 | 485 | ||
@@ -497,8 +498,21 @@ static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev, | |||
497 | card->ipato.enabled = (card->ipato.enabled)? 0 : 1; | 498 | card->ipato.enabled = (card->ipato.enabled)? 0 : 1; |
498 | } else if (!strcmp(tmp, "1")) { | 499 | } else if (!strcmp(tmp, "1")) { |
499 | card->ipato.enabled = 1; | 500 | card->ipato.enabled = 1; |
501 | list_for_each_entry_safe(tmpipa, t, card->ip_tbd_list, entry) { | ||
502 | if ((tmpipa->type == QETH_IP_TYPE_NORMAL) && | ||
503 | qeth_l3_is_addr_covered_by_ipato(card, tmpipa)) | ||
504 | tmpipa->set_flags |= | ||
505 | QETH_IPA_SETIP_TAKEOVER_FLAG; | ||
506 | } | ||
507 | |||
500 | } else if (!strcmp(tmp, "0")) { | 508 | } else if (!strcmp(tmp, "0")) { |
501 | card->ipato.enabled = 0; | 509 | card->ipato.enabled = 0; |
510 | list_for_each_entry_safe(tmpipa, t, card->ip_tbd_list, entry) { | ||
511 | if (tmpipa->set_flags & | ||
512 | QETH_IPA_SETIP_TAKEOVER_FLAG) | ||
513 | tmpipa->set_flags &= | ||
514 | ~QETH_IPA_SETIP_TAKEOVER_FLAG; | ||
515 | } | ||
502 | } else | 516 | } else |
503 | rc = -EINVAL; | 517 | rc = -EINVAL; |
504 | out: | 518 | out: |