Skip to content

Commit 1ca2212

Browse files
committed
Merge branch 's390-next'
Ursula Braun says: ==================== s390 patches for net-next here are some cleanup patches for drivers/s390/net. V2: respin, now patch "s390/qeth: improve endianness handling" is supposed to apply cleanly to net-next ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 45e60cb + 6c37c60 commit 1ca2212

File tree

10 files changed

+50
-90
lines changed

10 files changed

+50
-90
lines changed

drivers/s390/net/ctcm_fsms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ static void ctcmpc_chx_txdone(fsm_instance *fi, int event, void *arg)
12831283
p_header = (struct pdu *)
12841284
(skb_tail_pointer(ch->trans_skb) - skb->len);
12851285
p_header->pdu_flag = 0x00;
1286-
if (skb->protocol == ntohs(ETH_P_SNAP))
1286+
if (be16_to_cpu(skb->protocol) == ETH_P_SNAP)
12871287
p_header->pdu_flag |= 0x60;
12881288
else
12891289
p_header->pdu_flag |= 0x20;

drivers/s390/net/ctcm_main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb)
106106
priv->stats.rx_frame_errors++;
107107
return;
108108
}
109-
pskb->protocol = ntohs(header->type);
109+
pskb->protocol = cpu_to_be16(header->type);
110110
if ((header->length <= LL_HEADER_LENGTH) ||
111111
(len <= LL_HEADER_LENGTH)) {
112112
if (!(ch->logflags & LOG_FLAG_ILLEGALSIZE)) {
@@ -125,7 +125,7 @@ void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb)
125125
header->length -= LL_HEADER_LENGTH;
126126
len -= LL_HEADER_LENGTH;
127127
if ((header->length > skb_tailroom(pskb)) ||
128-
(header->length > len)) {
128+
(header->length > len)) {
129129
if (!(ch->logflags & LOG_FLAG_OVERRUN)) {
130130
CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR,
131131
"%s(%s): Packet size %d (overrun)"
@@ -485,7 +485,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb)
485485
} else {
486486
atomic_inc(&skb->users);
487487
header.length = l;
488-
header.type = skb->protocol;
488+
header.type = be16_to_cpu(skb->protocol);
489489
header.unused = 0;
490490
memcpy(skb_push(skb, LL_HEADER_LENGTH), &header,
491491
LL_HEADER_LENGTH);
@@ -503,7 +503,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb)
503503
atomic_inc(&skb->users);
504504
ch->prof.txlen += skb->len;
505505
header.length = skb->len + LL_HEADER_LENGTH;
506-
header.type = skb->protocol;
506+
header.type = be16_to_cpu(skb->protocol);
507507
header.unused = 0;
508508
memcpy(skb_push(skb, LL_HEADER_LENGTH), &header, LL_HEADER_LENGTH);
509509
block_len = skb->len + 2;
@@ -690,7 +690,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
690690
p_header->pdu_offset = skb->len;
691691
p_header->pdu_proto = 0x01;
692692
p_header->pdu_flag = 0x00;
693-
if (skb->protocol == ntohs(ETH_P_SNAP)) {
693+
if (be16_to_cpu(skb->protocol) == ETH_P_SNAP) {
694694
p_header->pdu_flag |= PDU_FIRST | PDU_CNTL;
695695
} else {
696696
p_header->pdu_flag |= PDU_FIRST;
@@ -745,7 +745,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
745745
p_header->pdu_proto = 0x01;
746746
p_header->pdu_flag = 0x00;
747747
p_header->pdu_seq = 0;
748-
if (skb->protocol == ntohs(ETH_P_SNAP)) {
748+
if (be16_to_cpu(skb->protocol) == ETH_P_SNAP) {
749749
p_header->pdu_flag |= PDU_FIRST | PDU_CNTL;
750750
} else {
751751
p_header->pdu_flag |= PDU_FIRST;

drivers/s390/net/netiucv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
635635
skb_put(pskb, NETIUCV_HDRLEN);
636636
pskb->dev = dev;
637637
pskb->ip_summed = CHECKSUM_NONE;
638-
pskb->protocol = ntohs(ETH_P_IP);
638+
pskb->protocol = cpu_to_be16(ETH_P_IP);
639639

640640
while (1) {
641641
struct sk_buff *skb;

drivers/s390/net/qeth_core.h

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -503,22 +503,12 @@ struct qeth_qdio_info {
503503
int default_out_queue;
504504
};
505505

506-
enum qeth_send_errors {
507-
QETH_SEND_ERROR_NONE,
508-
QETH_SEND_ERROR_LINK_FAILURE,
509-
QETH_SEND_ERROR_RETRY,
510-
QETH_SEND_ERROR_KICK_IT,
511-
};
512-
513506
#define QETH_ETH_MAC_V4 0x0100 /* like v4 */
514507
#define QETH_ETH_MAC_V6 0x3333 /* like v6 */
515508
/* tr mc mac is longer, but that will be enough to detect mc frames */
516509
#define QETH_TR_MAC_NC 0xc000 /* non-canonical */
517510
#define QETH_TR_MAC_C 0x0300 /* canonical */
518511

519-
#define DEFAULT_ADD_HHLEN 0
520-
#define MAX_ADD_HHLEN 1024
521-
522512
/**
523513
* buffer stuff for read channel
524514
*/
@@ -644,7 +634,6 @@ struct qeth_reply {
644634
atomic_t refcnt;
645635
};
646636

647-
648637
struct qeth_card_blkt {
649638
int time_total;
650639
int inter_packet;
@@ -685,7 +674,6 @@ struct qeth_card_options {
685674
struct qeth_ipa_info ipa6;
686675
struct qeth_sbp_info sbp; /* SETBRIDGEPORT options */
687676
int fake_broadcast;
688-
int add_hhlen;
689677
int layer2;
690678
int performance_stats;
691679
int rx_sg_cb;
@@ -856,9 +844,9 @@ static inline int qeth_get_ip_version(struct sk_buff *skb)
856844
{
857845
__be16 *p = &((struct ethhdr *)skb->data)->h_proto;
858846

859-
if (*p == ETH_P_8021Q)
847+
if (be16_to_cpu(*p) == ETH_P_8021Q)
860848
p += 2;
861-
switch (*p) {
849+
switch (be16_to_cpu(*p)) {
862850
case ETH_P_IPV6:
863851
return 6;
864852
case ETH_P_IP:

drivers/s390/net/qeth_core_main.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ static struct mutex qeth_mod_mutex;
5555

5656
static void qeth_send_control_data_cb(struct qeth_channel *,
5757
struct qeth_cmd_buffer *);
58-
static int qeth_issue_next_read(struct qeth_card *);
5958
static struct qeth_cmd_buffer *qeth_get_buffer(struct qeth_channel *);
6059
static void qeth_setup_ccw(struct qeth_channel *, unsigned char *, __u32);
6160
static void qeth_free_buffer_pool(struct qeth_card *);
@@ -1202,7 +1201,7 @@ static void qeth_notify_skbs(struct qeth_qdio_out_q *q,
12021201
while (skb) {
12031202
QETH_CARD_TEXT_(q->card, 5, "skbn%d", notification);
12041203
QETH_CARD_TEXT_(q->card, 5, "%lx", (long) skb);
1205-
if (skb->protocol == ETH_P_AF_IUCV) {
1204+
if (be16_to_cpu(skb->protocol) == ETH_P_AF_IUCV) {
12061205
if (skb->sk) {
12071206
struct iucv_sock *iucv = iucv_sk(skb->sk);
12081207
iucv->sk_txnotify(skb, notification);
@@ -1233,7 +1232,8 @@ static void qeth_release_skbs(struct qeth_qdio_out_buffer *buf)
12331232
while (skb) {
12341233
QETH_CARD_TEXT(buf->q->card, 5, "skbr");
12351234
QETH_CARD_TEXT_(buf->q->card, 5, "%lx", (long) skb);
1236-
if (notify_general_error && skb->protocol == ETH_P_AF_IUCV) {
1235+
if (notify_general_error &&
1236+
be16_to_cpu(skb->protocol) == ETH_P_AF_IUCV) {
12371237
if (skb->sk) {
12381238
iucv = iucv_sk(skb->sk);
12391239
iucv->sk_txnotify(skb, TX_NOTIFY_GENERALERROR);
@@ -1396,7 +1396,6 @@ static void qeth_set_intial_options(struct qeth_card *card)
13961396
card->options.route4.type = NO_ROUTER;
13971397
card->options.route6.type = NO_ROUTER;
13981398
card->options.fake_broadcast = 0;
1399-
card->options.add_hhlen = DEFAULT_ADD_HHLEN;
14001399
card->options.performance_stats = 0;
14011400
card->options.rx_sg_cb = QETH_RX_SG_CB;
14021401
card->options.isolation = ISOLATION_MODE_NONE;
@@ -3322,7 +3321,7 @@ void qeth_queue_input_buffer(struct qeth_card *card, int index)
33223321
}
33233322
EXPORT_SYMBOL_GPL(qeth_queue_input_buffer);
33243323

3325-
static int qeth_handle_send_error(struct qeth_card *card,
3324+
static void qeth_handle_send_error(struct qeth_card *card,
33263325
struct qeth_qdio_out_buffer *buffer, unsigned int qdio_err)
33273326
{
33283327
int sbalf15 = buffer->buffer->element[15].sflags;
@@ -3338,15 +3337,14 @@ static int qeth_handle_send_error(struct qeth_card *card,
33383337
qeth_check_qdio_errors(card, buffer->buffer, qdio_err, "qouterr");
33393338

33403339
if (!qdio_err)
3341-
return QETH_SEND_ERROR_NONE;
3340+
return;
33423341

33433342
if ((sbalf15 >= 15) && (sbalf15 <= 31))
3344-
return QETH_SEND_ERROR_RETRY;
3343+
return;
33453344

33463345
QETH_CARD_TEXT(card, 1, "lnkfail");
33473346
QETH_CARD_TEXT_(card, 1, "%04x %02x",
33483347
(u16)qdio_err, (u8)sbalf15);
3349-
return QETH_SEND_ERROR_LINK_FAILURE;
33503348
}
33513349

33523350
/*
@@ -3799,9 +3797,9 @@ int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
37993797
return qeth_cut_iqd_prio(card, ~skb->priority >> 1 & 3);
38003798
case QETH_PRIO_Q_ING_VLAN:
38013799
tci = &((struct ethhdr *)skb->data)->h_proto;
3802-
if (*tci == ETH_P_8021Q)
3803-
return qeth_cut_iqd_prio(card, ~*(tci + 1) >>
3804-
(VLAN_PRIO_SHIFT + 1) & 3);
3800+
if (be16_to_cpu(*tci) == ETH_P_8021Q)
3801+
return qeth_cut_iqd_prio(card,
3802+
~be16_to_cpu(*(tci + 1)) >> (VLAN_PRIO_SHIFT + 1) & 3);
38053803
break;
38063804
default:
38073805
break;
@@ -4775,12 +4773,10 @@ static int qeth_query_card_info(struct qeth_card *card,
47754773

47764774
static inline int qeth_get_qdio_q_format(struct qeth_card *card)
47774775
{
4778-
switch (card->info.type) {
4779-
case QETH_CARD_TYPE_IQD:
4780-
return 2;
4781-
default:
4782-
return 0;
4783-
}
4776+
if (card->info.type == QETH_CARD_TYPE_IQD)
4777+
return QDIO_IQDIO_QFMT;
4778+
else
4779+
return QDIO_QETH_QFMT;
47844780
}
47854781

47864782
static void qeth_determine_capabilities(struct qeth_card *card)
@@ -4819,8 +4815,9 @@ static void qeth_determine_capabilities(struct qeth_card *card)
48194815
QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
48204816

48214817
QETH_DBF_TEXT_(SETUP, 2, "qfmt%d", card->ssqd.qfmt);
4822-
QETH_DBF_TEXT_(SETUP, 2, "%d", card->ssqd.qdioac1);
4823-
QETH_DBF_TEXT_(SETUP, 2, "%d", card->ssqd.qdioac3);
4818+
QETH_DBF_TEXT_(SETUP, 2, "ac1:%02x", card->ssqd.qdioac1);
4819+
QETH_DBF_TEXT_(SETUP, 2, "ac2:%04x", card->ssqd.qdioac2);
4820+
QETH_DBF_TEXT_(SETUP, 2, "ac3:%04x", card->ssqd.qdioac3);
48244821
QETH_DBF_TEXT_(SETUP, 2, "icnt%d", card->ssqd.icnt);
48254822
if (!((card->ssqd.qfmt != QDIO_IQDIO_QFMT) ||
48264823
((card->ssqd.qdioac1 & CHSC_AC1_INITIATE_INPUTQ) == 0) ||

drivers/s390/net/qeth_core_mpc.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ extern unsigned char IPA_PDU_HEADER[];
2929
#define QETH_TIMEOUT (10 * HZ)
3030
#define QETH_IPA_TIMEOUT (45 * HZ)
3131
#define QETH_IDX_COMMAND_SEQNO 0xffff0000
32-
#define SR_INFO_LEN 16
3332

3433
#define QETH_CLEAR_CHANNEL_PARM -10
3534
#define QETH_HALT_CHANNEL_PARM -11
@@ -65,7 +64,6 @@ enum qeth_link_types {
6564
QETH_LINK_TYPE_LANE_TR = 0x82,
6665
QETH_LINK_TYPE_LANE_ETH1000 = 0x83,
6766
QETH_LINK_TYPE_LANE = 0x88,
68-
QETH_LINK_TYPE_ATM_NATIVE = 0x90,
6967
};
7068

7169
/*
@@ -185,8 +183,6 @@ enum qeth_ipa_return_codes {
185183
IPA_RC_ENOMEM = 0xfffe,
186184
IPA_RC_FFFF = 0xffff
187185
};
188-
/* for DELIP */
189-
#define IPA_RC_IP_ADDRESS_NOT_DEFINED IPA_RC_PRIMARY_ALREADY_DEFINED
190186
/* for SET_DIAGNOSTIC_ASSIST */
191187
#define IPA_RC_INVALID_SUBCMD IPA_RC_IP_TABLE_FULL
192188
#define IPA_RC_HARDWARE_AUTH_ERROR IPA_RC_UNKNOWN_ERROR
@@ -631,14 +627,6 @@ enum qeth_ipa_addr_change_code {
631627
IPA_ADDR_CHANGE_CODE_MACADDR = 0x02,
632628
IPA_ADDR_CHANGE_CODE_REMOVAL = 0x80, /* else addition */
633629
};
634-
enum qeth_ipa_addr_change_retcode {
635-
IPA_ADDR_CHANGE_RETCODE_OK = 0x0000,
636-
IPA_ADDR_CHANGE_RETCODE_LOSTEVENTS = 0x0010,
637-
};
638-
enum qeth_ipa_addr_change_lostmask {
639-
IPA_ADDR_CHANGE_MASK_OVERFLOW = 0x01,
640-
IPA_ADDR_CHANGE_MASK_STATECHANGE = 0x02,
641-
};
642630

643631
struct qeth_ipacmd_addr_change_entry {
644632
struct net_if_token token;
@@ -817,9 +805,4 @@ extern unsigned char IDX_ACTIVATE_WRITE[];
817805
((buffer) && \
818806
(*(buffer + ((*(buffer + 0x0b)) + 4)) == 0xc1))
819807

820-
#define ADDR_FRAME_TYPE_DIX 1
821-
#define ADDR_FRAME_TYPE_802_3 2
822-
#define ADDR_FRAME_TYPE_TR_WITHOUT_SR 0x10
823-
#define ADDR_FRAME_TYPE_TR_WITH_SR 0x20
824-
825808
#endif

drivers/s390/net/qeth_l2_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
static int qeth_l2_set_offline(struct ccwgroup_device *);
2929
static int qeth_l2_stop(struct net_device *);
3030
static void qeth_l2_set_rx_mode(struct net_device *);
31-
static int qeth_l2_recover(void *);
3231
static void qeth_bridgeport_query_support(struct qeth_card *card);
3332
static void qeth_bridge_state_change(struct qeth_card *card,
3433
struct qeth_ipa_cmd *cmd);

drivers/s390/net/qeth_l2_sys.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
#include "qeth_core.h"
99
#include "qeth_l2.h"
1010

11-
#define QETH_DEVICE_ATTR(_id, _name, _mode, _show, _store) \
12-
struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store)
13-
1411
static ssize_t qeth_bridge_port_role_state_show(struct device *dev,
1512
struct device_attribute *attr, char *buf,
1613
int show_state)

0 commit comments

Comments
 (0)