Skip to content

Commit

Permalink
Merge branch 's390-next'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Apr 7, 2017
2 parents 45e60cb + 6c37c60 commit 1ca2212
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 90 deletions.
2 changes: 1 addition & 1 deletion drivers/s390/net/ctcm_fsms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ static void ctcmpc_chx_txdone(fsm_instance *fi, int event, void *arg)
p_header = (struct pdu *)
(skb_tail_pointer(ch->trans_skb) - skb->len);
p_header->pdu_flag = 0x00;
if (skb->protocol == ntohs(ETH_P_SNAP))
if (be16_to_cpu(skb->protocol) == ETH_P_SNAP)
p_header->pdu_flag |= 0x60;
else
p_header->pdu_flag |= 0x20;
Expand Down
12 changes: 6 additions & 6 deletions drivers/s390/net/ctcm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb)
priv->stats.rx_frame_errors++;
return;
}
pskb->protocol = ntohs(header->type);
pskb->protocol = cpu_to_be16(header->type);
if ((header->length <= LL_HEADER_LENGTH) ||
(len <= LL_HEADER_LENGTH)) {
if (!(ch->logflags & LOG_FLAG_ILLEGALSIZE)) {
Expand All @@ -125,7 +125,7 @@ void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb)
header->length -= LL_HEADER_LENGTH;
len -= LL_HEADER_LENGTH;
if ((header->length > skb_tailroom(pskb)) ||
(header->length > len)) {
(header->length > len)) {
if (!(ch->logflags & LOG_FLAG_OVERRUN)) {
CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR,
"%s(%s): Packet size %d (overrun)"
Expand Down Expand Up @@ -485,7 +485,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb)
} else {
atomic_inc(&skb->users);
header.length = l;
header.type = skb->protocol;
header.type = be16_to_cpu(skb->protocol);
header.unused = 0;
memcpy(skb_push(skb, LL_HEADER_LENGTH), &header,
LL_HEADER_LENGTH);
Expand All @@ -503,7 +503,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb)
atomic_inc(&skb->users);
ch->prof.txlen += skb->len;
header.length = skb->len + LL_HEADER_LENGTH;
header.type = skb->protocol;
header.type = be16_to_cpu(skb->protocol);
header.unused = 0;
memcpy(skb_push(skb, LL_HEADER_LENGTH), &header, LL_HEADER_LENGTH);
block_len = skb->len + 2;
Expand Down Expand Up @@ -690,7 +690,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
p_header->pdu_offset = skb->len;
p_header->pdu_proto = 0x01;
p_header->pdu_flag = 0x00;
if (skb->protocol == ntohs(ETH_P_SNAP)) {
if (be16_to_cpu(skb->protocol) == ETH_P_SNAP) {
p_header->pdu_flag |= PDU_FIRST | PDU_CNTL;
} else {
p_header->pdu_flag |= PDU_FIRST;
Expand Down Expand Up @@ -745,7 +745,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
p_header->pdu_proto = 0x01;
p_header->pdu_flag = 0x00;
p_header->pdu_seq = 0;
if (skb->protocol == ntohs(ETH_P_SNAP)) {
if (be16_to_cpu(skb->protocol) == ETH_P_SNAP) {
p_header->pdu_flag |= PDU_FIRST | PDU_CNTL;
} else {
p_header->pdu_flag |= PDU_FIRST;
Expand Down
2 changes: 1 addition & 1 deletion drivers/s390/net/netiucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
skb_put(pskb, NETIUCV_HDRLEN);
pskb->dev = dev;
pskb->ip_summed = CHECKSUM_NONE;
pskb->protocol = ntohs(ETH_P_IP);
pskb->protocol = cpu_to_be16(ETH_P_IP);

while (1) {
struct sk_buff *skb;
Expand Down
16 changes: 2 additions & 14 deletions drivers/s390/net/qeth_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,22 +503,12 @@ struct qeth_qdio_info {
int default_out_queue;
};

enum qeth_send_errors {
QETH_SEND_ERROR_NONE,
QETH_SEND_ERROR_LINK_FAILURE,
QETH_SEND_ERROR_RETRY,
QETH_SEND_ERROR_KICK_IT,
};

#define QETH_ETH_MAC_V4 0x0100 /* like v4 */
#define QETH_ETH_MAC_V6 0x3333 /* like v6 */
/* tr mc mac is longer, but that will be enough to detect mc frames */
#define QETH_TR_MAC_NC 0xc000 /* non-canonical */
#define QETH_TR_MAC_C 0x0300 /* canonical */

#define DEFAULT_ADD_HHLEN 0
#define MAX_ADD_HHLEN 1024

/**
* buffer stuff for read channel
*/
Expand Down Expand Up @@ -644,7 +634,6 @@ struct qeth_reply {
atomic_t refcnt;
};


struct qeth_card_blkt {
int time_total;
int inter_packet;
Expand Down Expand Up @@ -685,7 +674,6 @@ struct qeth_card_options {
struct qeth_ipa_info ipa6;
struct qeth_sbp_info sbp; /* SETBRIDGEPORT options */
int fake_broadcast;
int add_hhlen;
int layer2;
int performance_stats;
int rx_sg_cb;
Expand Down Expand Up @@ -856,9 +844,9 @@ static inline int qeth_get_ip_version(struct sk_buff *skb)
{
__be16 *p = &((struct ethhdr *)skb->data)->h_proto;

if (*p == ETH_P_8021Q)
if (be16_to_cpu(*p) == ETH_P_8021Q)
p += 2;
switch (*p) {
switch (be16_to_cpu(*p)) {
case ETH_P_IPV6:
return 6;
case ETH_P_IP:
Expand Down
35 changes: 16 additions & 19 deletions drivers/s390/net/qeth_core_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ static struct mutex qeth_mod_mutex;

static void qeth_send_control_data_cb(struct qeth_channel *,
struct qeth_cmd_buffer *);
static int qeth_issue_next_read(struct qeth_card *);
static struct qeth_cmd_buffer *qeth_get_buffer(struct qeth_channel *);
static void qeth_setup_ccw(struct qeth_channel *, unsigned char *, __u32);
static void qeth_free_buffer_pool(struct qeth_card *);
Expand Down Expand Up @@ -1202,7 +1201,7 @@ static void qeth_notify_skbs(struct qeth_qdio_out_q *q,
while (skb) {
QETH_CARD_TEXT_(q->card, 5, "skbn%d", notification);
QETH_CARD_TEXT_(q->card, 5, "%lx", (long) skb);
if (skb->protocol == ETH_P_AF_IUCV) {
if (be16_to_cpu(skb->protocol) == ETH_P_AF_IUCV) {
if (skb->sk) {
struct iucv_sock *iucv = iucv_sk(skb->sk);
iucv->sk_txnotify(skb, notification);
Expand Down Expand Up @@ -1233,7 +1232,8 @@ static void qeth_release_skbs(struct qeth_qdio_out_buffer *buf)
while (skb) {
QETH_CARD_TEXT(buf->q->card, 5, "skbr");
QETH_CARD_TEXT_(buf->q->card, 5, "%lx", (long) skb);
if (notify_general_error && skb->protocol == ETH_P_AF_IUCV) {
if (notify_general_error &&
be16_to_cpu(skb->protocol) == ETH_P_AF_IUCV) {
if (skb->sk) {
iucv = iucv_sk(skb->sk);
iucv->sk_txnotify(skb, TX_NOTIFY_GENERALERROR);
Expand Down Expand Up @@ -1396,7 +1396,6 @@ static void qeth_set_intial_options(struct qeth_card *card)
card->options.route4.type = NO_ROUTER;
card->options.route6.type = NO_ROUTER;
card->options.fake_broadcast = 0;
card->options.add_hhlen = DEFAULT_ADD_HHLEN;
card->options.performance_stats = 0;
card->options.rx_sg_cb = QETH_RX_SG_CB;
card->options.isolation = ISOLATION_MODE_NONE;
Expand Down Expand Up @@ -3322,7 +3321,7 @@ void qeth_queue_input_buffer(struct qeth_card *card, int index)
}
EXPORT_SYMBOL_GPL(qeth_queue_input_buffer);

static int qeth_handle_send_error(struct qeth_card *card,
static void qeth_handle_send_error(struct qeth_card *card,
struct qeth_qdio_out_buffer *buffer, unsigned int qdio_err)
{
int sbalf15 = buffer->buffer->element[15].sflags;
Expand All @@ -3338,15 +3337,14 @@ static int qeth_handle_send_error(struct qeth_card *card,
qeth_check_qdio_errors(card, buffer->buffer, qdio_err, "qouterr");

if (!qdio_err)
return QETH_SEND_ERROR_NONE;
return;

if ((sbalf15 >= 15) && (sbalf15 <= 31))
return QETH_SEND_ERROR_RETRY;
return;

QETH_CARD_TEXT(card, 1, "lnkfail");
QETH_CARD_TEXT_(card, 1, "%04x %02x",
(u16)qdio_err, (u8)sbalf15);
return QETH_SEND_ERROR_LINK_FAILURE;
}

/*
Expand Down Expand Up @@ -3799,9 +3797,9 @@ int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
return qeth_cut_iqd_prio(card, ~skb->priority >> 1 & 3);
case QETH_PRIO_Q_ING_VLAN:
tci = &((struct ethhdr *)skb->data)->h_proto;
if (*tci == ETH_P_8021Q)
return qeth_cut_iqd_prio(card, ~*(tci + 1) >>
(VLAN_PRIO_SHIFT + 1) & 3);
if (be16_to_cpu(*tci) == ETH_P_8021Q)
return qeth_cut_iqd_prio(card,
~be16_to_cpu(*(tci + 1)) >> (VLAN_PRIO_SHIFT + 1) & 3);
break;
default:
break;
Expand Down Expand Up @@ -4775,12 +4773,10 @@ static int qeth_query_card_info(struct qeth_card *card,

static inline int qeth_get_qdio_q_format(struct qeth_card *card)
{
switch (card->info.type) {
case QETH_CARD_TYPE_IQD:
return 2;
default:
return 0;
}
if (card->info.type == QETH_CARD_TYPE_IQD)
return QDIO_IQDIO_QFMT;
else
return QDIO_QETH_QFMT;
}

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

QETH_DBF_TEXT_(SETUP, 2, "qfmt%d", card->ssqd.qfmt);
QETH_DBF_TEXT_(SETUP, 2, "%d", card->ssqd.qdioac1);
QETH_DBF_TEXT_(SETUP, 2, "%d", card->ssqd.qdioac3);
QETH_DBF_TEXT_(SETUP, 2, "ac1:%02x", card->ssqd.qdioac1);
QETH_DBF_TEXT_(SETUP, 2, "ac2:%04x", card->ssqd.qdioac2);
QETH_DBF_TEXT_(SETUP, 2, "ac3:%04x", card->ssqd.qdioac3);
QETH_DBF_TEXT_(SETUP, 2, "icnt%d", card->ssqd.icnt);
if (!((card->ssqd.qfmt != QDIO_IQDIO_QFMT) ||
((card->ssqd.qdioac1 & CHSC_AC1_INITIATE_INPUTQ) == 0) ||
Expand Down
17 changes: 0 additions & 17 deletions drivers/s390/net/qeth_core_mpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ extern unsigned char IPA_PDU_HEADER[];
#define QETH_TIMEOUT (10 * HZ)
#define QETH_IPA_TIMEOUT (45 * HZ)
#define QETH_IDX_COMMAND_SEQNO 0xffff0000
#define SR_INFO_LEN 16

#define QETH_CLEAR_CHANNEL_PARM -10
#define QETH_HALT_CHANNEL_PARM -11
Expand Down Expand Up @@ -65,7 +64,6 @@ enum qeth_link_types {
QETH_LINK_TYPE_LANE_TR = 0x82,
QETH_LINK_TYPE_LANE_ETH1000 = 0x83,
QETH_LINK_TYPE_LANE = 0x88,
QETH_LINK_TYPE_ATM_NATIVE = 0x90,
};

/*
Expand Down Expand Up @@ -185,8 +183,6 @@ enum qeth_ipa_return_codes {
IPA_RC_ENOMEM = 0xfffe,
IPA_RC_FFFF = 0xffff
};
/* for DELIP */
#define IPA_RC_IP_ADDRESS_NOT_DEFINED IPA_RC_PRIMARY_ALREADY_DEFINED
/* for SET_DIAGNOSTIC_ASSIST */
#define IPA_RC_INVALID_SUBCMD IPA_RC_IP_TABLE_FULL
#define IPA_RC_HARDWARE_AUTH_ERROR IPA_RC_UNKNOWN_ERROR
Expand Down Expand Up @@ -631,14 +627,6 @@ enum qeth_ipa_addr_change_code {
IPA_ADDR_CHANGE_CODE_MACADDR = 0x02,
IPA_ADDR_CHANGE_CODE_REMOVAL = 0x80, /* else addition */
};
enum qeth_ipa_addr_change_retcode {
IPA_ADDR_CHANGE_RETCODE_OK = 0x0000,
IPA_ADDR_CHANGE_RETCODE_LOSTEVENTS = 0x0010,
};
enum qeth_ipa_addr_change_lostmask {
IPA_ADDR_CHANGE_MASK_OVERFLOW = 0x01,
IPA_ADDR_CHANGE_MASK_STATECHANGE = 0x02,
};

struct qeth_ipacmd_addr_change_entry {
struct net_if_token token;
Expand Down Expand Up @@ -817,9 +805,4 @@ extern unsigned char IDX_ACTIVATE_WRITE[];
((buffer) && \
(*(buffer + ((*(buffer + 0x0b)) + 4)) == 0xc1))

#define ADDR_FRAME_TYPE_DIX 1
#define ADDR_FRAME_TYPE_802_3 2
#define ADDR_FRAME_TYPE_TR_WITHOUT_SR 0x10
#define ADDR_FRAME_TYPE_TR_WITH_SR 0x20

#endif
1 change: 0 additions & 1 deletion drivers/s390/net/qeth_l2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
static int qeth_l2_set_offline(struct ccwgroup_device *);
static int qeth_l2_stop(struct net_device *);
static void qeth_l2_set_rx_mode(struct net_device *);
static int qeth_l2_recover(void *);
static void qeth_bridgeport_query_support(struct qeth_card *card);
static void qeth_bridge_state_change(struct qeth_card *card,
struct qeth_ipa_cmd *cmd);
Expand Down
3 changes: 0 additions & 3 deletions drivers/s390/net/qeth_l2_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
#include "qeth_core.h"
#include "qeth_l2.h"

#define QETH_DEVICE_ATTR(_id, _name, _mode, _show, _store) \
struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store)

static ssize_t qeth_bridge_port_role_state_show(struct device *dev,
struct device_attribute *attr, char *buf,
int show_state)
Expand Down
Loading

0 comments on commit 1ca2212

Please sign in to comment.