Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f36e000 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 's390-net-next'



Julian Wiedmann says:

====================
s390/net: updates 2017-12-20

Please apply the following patch series for 4.16.
Nothing too exciting, mostly just beating the qeth L3 code into shape.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a943e8bc 556fd271
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -91,9 +91,6 @@ config QETH_L3
	  To compile as a module choose M. The module name is qeth_l3.
	  If unsure, choose Y.

config QETH_IPV6
	def_bool y if (QETH_L3 = IPV6) || (QETH_L3 && IPV6 = 'y')

config CCWGROUP
	tristate
	default (LCS || CTCM || QETH)
+3 −7
Original line number Diff line number Diff line
@@ -756,20 +756,16 @@ lcs_get_lancmd(struct lcs_card *card, int count)
static void
lcs_get_reply(struct lcs_reply *reply)
{
	WARN_ON(atomic_read(&reply->refcnt) <= 0);
	atomic_inc(&reply->refcnt);
	refcount_inc(&reply->refcnt);
}

static void
lcs_put_reply(struct lcs_reply *reply)
{
        WARN_ON(atomic_read(&reply->refcnt) <= 0);
        if (atomic_dec_and_test(&reply->refcnt)) {
	if (refcount_dec_and_test(&reply->refcnt))
		kfree(reply);
}

}

static struct lcs_reply *
lcs_alloc_reply(struct lcs_cmd *cmd)
{
@@ -780,7 +776,7 @@ lcs_alloc_reply(struct lcs_cmd *cmd)
	reply = kzalloc(sizeof(struct lcs_reply), GFP_ATOMIC);
	if (!reply)
		return NULL;
	atomic_set(&reply->refcnt,1);
	refcount_set(&reply->refcnt, 1);
	reply->sequence_no = cmd->sequence_no;
	reply->received = 0;
	reply->rc = 0;
+2 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/workqueue.h>
#include <linux/refcount.h>
#include <asm/ccwdev.h>

#define LCS_DBF_TEXT(level, name, text) \
@@ -271,7 +272,7 @@ struct lcs_buffer {
struct lcs_reply {
	struct list_head list;
	__u16 sequence_no;
	atomic_t refcnt;
	refcount_t refcnt;
	/* Callback for completion notification. */
	void (*callback)(struct lcs_card *, struct lcs_cmd *);
	wait_queue_head_t wait_q;
+27 −15
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/ethtool.h>
#include <linux/hashtable.h>
#include <linux/ip.h>
#include <linux/refcount.h>

#include <net/ipv6.h>
#include <net/if_inet6.h>
@@ -296,8 +297,23 @@ struct qeth_hdr_layer3 {
	__u8  ext_flags;
	__u16 vlan_id;
	__u16 frame_offset;
	__u8  dest_addr[16];
} __attribute__ ((packed));
	union {
		/* TX: */
		u8 ipv6_addr[16];
		struct ipv4 {
			u8 res[12];
			u32 addr;
		} ipv4;
		/* RX: */
		struct rx {
			u8 res1[2];
			u8 src_mac[6];
			u8 res2[4];
			u16 vlan_id;
			u8 res3[2];
		} rx;
	} next_hop;
};

struct qeth_hdr_layer2 {
	__u8 id;
@@ -504,12 +520,6 @@ struct qeth_qdio_info {
	int default_out_queue;
};

#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 */

/**
 * buffer stuff for read channel
 */
@@ -632,7 +642,7 @@ struct qeth_reply {
	int rc;
	void *param;
	struct qeth_card *card;
	atomic_t refcnt;
	refcount_t refcnt;
};

struct qeth_card_blkt {
@@ -846,14 +856,16 @@ static inline int qeth_get_micros(void)

static inline int qeth_get_ip_version(struct sk_buff *skb)
{
	__be16 *p = &((struct ethhdr *)skb->data)->h_proto;
	struct vlan_ethhdr *veth = vlan_eth_hdr(skb);
	__be16 prot = veth->h_vlan_proto;

	if (prot == htons(ETH_P_8021Q))
		prot = veth->h_vlan_encapsulated_proto;

	if (be16_to_cpu(*p) == ETH_P_8021Q)
		p += 2;
	switch (be16_to_cpu(*p)) {
	case ETH_P_IPV6:
	switch (prot) {
	case htons(ETH_P_IPV6):
		return 6;
	case ETH_P_IP:
	case htons(ETH_P_IP):
		return 4;
	default:
		return 0;
+8 −11
Original line number Diff line number Diff line
@@ -564,7 +564,7 @@ static struct qeth_reply *qeth_alloc_reply(struct qeth_card *card)

	reply = kzalloc(sizeof(struct qeth_reply), GFP_ATOMIC);
	if (reply) {
		atomic_set(&reply->refcnt, 1);
		refcount_set(&reply->refcnt, 1);
		atomic_set(&reply->received, 0);
		reply->card = card;
	}
@@ -573,14 +573,12 @@ static struct qeth_reply *qeth_alloc_reply(struct qeth_card *card)

static void qeth_get_reply(struct qeth_reply *reply)
{
	WARN_ON(atomic_read(&reply->refcnt) <= 0);
	atomic_inc(&reply->refcnt);
	refcount_inc(&reply->refcnt);
}

static void qeth_put_reply(struct qeth_reply *reply)
{
	WARN_ON(atomic_read(&reply->refcnt) <= 0);
	if (atomic_dec_and_test(&reply->refcnt))
	if (refcount_dec_and_test(&reply->refcnt))
		kfree(reply);
}

@@ -4218,9 +4216,8 @@ static int qeth_setadpparms_change_macaddr_cb(struct qeth_card *card,
	cmd = (struct qeth_ipa_cmd *) data;
	if (!card->options.layer2 ||
	    !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) {
		memcpy(card->dev->dev_addr,
		       &cmd->data.setadapterparms.data.change_addr.addr,
		       OSA_ADDR_LEN);
		ether_addr_copy(card->dev->dev_addr,
				cmd->data.setadapterparms.data.change_addr.addr);
		card->info.mac_bits |= QETH_LAYER2_MAC_READ;
	}
	qeth_default_setadapterparms_cb(card, reply, (unsigned long) cmd);
@@ -4242,9 +4239,9 @@ int qeth_setadpparms_change_macaddr(struct qeth_card *card)
		return -ENOMEM;
	cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
	cmd->data.setadapterparms.data.change_addr.cmd = CHANGE_ADDR_READ_MAC;
	cmd->data.setadapterparms.data.change_addr.addr_size = OSA_ADDR_LEN;
	memcpy(&cmd->data.setadapterparms.data.change_addr.addr,
	       card->dev->dev_addr, OSA_ADDR_LEN);
	cmd->data.setadapterparms.data.change_addr.addr_size = ETH_ALEN;
	ether_addr_copy(cmd->data.setadapterparms.data.change_addr.addr,
			card->dev->dev_addr);
	rc = qeth_send_ipa_cmd(card, iob, qeth_setadpparms_change_macaddr_cb,
			       NULL);
	return rc;
Loading