Skip to content

Commit

Permalink
[PATCH] s390: introducing support in qeth for new OSA CHPID type OSN
Browse files Browse the repository at this point in the history
	This patch introduces new feature in qeth:
	qeth enhancement provides the device driver support for
        the Communication Controller for Linux on System z9 and zSeries
        (CCL), which is software that enables running the Network Control
        Program (NCP) on a zSeries machine. The OSA CDLC support is based
        on a new IBM mainframe CHPID type called Open Systems Adaper for
        NCP (OSN). In case of OSN qeth communicates with the type-OSN
        OSA-card on one hand, and with the CCL-kernel-component Network
        Device Handler (NDH) on the other.

Signed-off-by: Frank Pavlic <pavlic@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Ursula Braun authored and Jeff Garzik committed Oct 4, 2005
1 parent 3c8c7b2 commit 500f83a
Show file tree
Hide file tree
Showing 6 changed files with 413 additions and 112 deletions.
45 changes: 42 additions & 3 deletions drivers/s390/net/qeth.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ qeth_is_ipa_enabled(struct qeth_ipa_info *ipa, enum qeth_ipa_funcs func)
QETH_IDX_FUNC_LEVEL_IQD_ENA_IPAT, \
QETH_IDX_FUNC_LEVEL_IQD_DIS_IPAT, \
QETH_MAX_QUEUES,0x103}, \
{0x1731,0x06,0x1732,0x06,QETH_CARD_TYPE_OSN,0, \
QETH_IDX_FUNC_LEVEL_OSAE_ENA_IPAT, \
QETH_IDX_FUNC_LEVEL_OSAE_DIS_IPAT, \
QETH_MAX_QUEUES,0}, \
{0,0,0,0,0,0,0,0,0}}

#define QETH_REAL_CARD 1
Expand Down Expand Up @@ -363,10 +367,22 @@ struct qeth_hdr_layer2 {
__u8 reserved2[16];
} __attribute__ ((packed));

struct qeth_hdr_osn {
__u8 id;
__u8 reserved;
__u16 seq_no;
__u16 reserved2;
__u16 control_flags;
__u16 pdu_length;
__u8 reserved3[18];
__u32 ccid;
} __attribute__ ((packed));

struct qeth_hdr {
union {
struct qeth_hdr_layer2 l2;
struct qeth_hdr_layer3 l3;
struct qeth_hdr_osn osn;
} hdr;
} __attribute__ ((packed));

Expand Down Expand Up @@ -413,6 +429,7 @@ enum qeth_header_ids {
QETH_HEADER_TYPE_LAYER3 = 0x01,
QETH_HEADER_TYPE_LAYER2 = 0x02,
QETH_HEADER_TYPE_TSO = 0x03,
QETH_HEADER_TYPE_OSN = 0x04,
};
/* flags for qeth_hdr.ext_flags */
#define QETH_HDR_EXT_VLAN_FRAME 0x01
Expand Down Expand Up @@ -582,7 +599,6 @@ enum qeth_card_states {
* Protocol versions
*/
enum qeth_prot_versions {
QETH_PROT_SNA = 0x0001,
QETH_PROT_IPV4 = 0x0004,
QETH_PROT_IPV6 = 0x0006,
};
Expand Down Expand Up @@ -761,6 +777,11 @@ enum qeth_threads {
QETH_RECOVER_THREAD = 2,
};

struct qeth_osn_info {
int (*assist_cb)(struct net_device *dev, void *data);
int (*data_cb)(struct sk_buff *skb);
};

struct qeth_card {
struct list_head list;
enum qeth_card_states state;
Expand Down Expand Up @@ -803,6 +824,7 @@ struct qeth_card {
int use_hard_stop;
int (*orig_hard_header)(struct sk_buff *,struct net_device *,
unsigned short,void *,void *,unsigned);
struct qeth_osn_info osn_info;
};

struct qeth_card_list_struct {
Expand Down Expand Up @@ -916,10 +938,12 @@ qeth_get_hlen(__u8 link_type)
static inline unsigned short
qeth_get_netdev_flags(struct qeth_card *card)
{
if (card->options.layer2)
if (card->options.layer2 &&
(card->info.type == QETH_CARD_TYPE_OSAE))
return 0;
switch (card->info.type) {
case QETH_CARD_TYPE_IQD:
case QETH_CARD_TYPE_OSN:
return IFF_NOARP;
#ifdef CONFIG_QETH_IPV6
default:
Expand Down Expand Up @@ -956,9 +980,10 @@ static inline int
qeth_get_max_mtu_for_card(int cardtype)
{
switch (cardtype) {

case QETH_CARD_TYPE_UNKNOWN:
return 61440;
case QETH_CARD_TYPE_OSAE:
case QETH_CARD_TYPE_OSN:
return 61440;
case QETH_CARD_TYPE_IQD:
return 57344;
Expand Down Expand Up @@ -1004,6 +1029,7 @@ qeth_mtu_is_valid(struct qeth_card * card, int mtu)
case QETH_CARD_TYPE_IQD:
return ((mtu >= 576) &&
(mtu <= card->info.max_mtu + 4096 - 32));
case QETH_CARD_TYPE_OSN:
case QETH_CARD_TYPE_UNKNOWN:
default:
return 1;
Expand All @@ -1015,6 +1041,7 @@ qeth_get_arphdr_type(int cardtype, int linktype)
{
switch (cardtype) {
case QETH_CARD_TYPE_OSAE:
case QETH_CARD_TYPE_OSN:
switch (linktype) {
case QETH_LINK_TYPE_LANE_TR:
case QETH_LINK_TYPE_HSTR:
Expand Down Expand Up @@ -1182,4 +1209,16 @@ qeth_fill_header(struct qeth_card *, struct qeth_hdr *,
extern void
qeth_flush_buffers(struct qeth_qdio_out_q *, int, int, int);

extern int
qeth_osn_assist(struct net_device *, void *, int);

extern int
qeth_osn_register(unsigned char *read_dev_no,
struct net_device **,
int (*assist_cb)(struct net_device *, void *),
int (*data_cb)(struct sk_buff *));

extern void
qeth_osn_deregister(struct net_device *);

#endif /* __QETH_H__ */
12 changes: 11 additions & 1 deletion drivers/s390/net/qeth_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#ifndef __QETH_FS_H__
#define __QETH_FS_H__

#define VERSION_QETH_FS_H "$Revision: 1.9 $"
#define VERSION_QETH_FS_H "$Revision: 1.10 $"

extern const char *VERSION_QETH_PROC_C;
extern const char *VERSION_QETH_SYS_C;
Expand Down Expand Up @@ -42,6 +42,12 @@ qeth_create_device_attributes(struct device *dev);
extern void
qeth_remove_device_attributes(struct device *dev);

extern int
qeth_create_device_attributes_osn(struct device *dev);

extern void
qeth_remove_device_attributes_osn(struct device *dev);

extern int
qeth_create_driver_attributes(void);

Expand Down Expand Up @@ -108,6 +114,8 @@ qeth_get_cardname(struct qeth_card *card)
return " OSD Express";
case QETH_CARD_TYPE_IQD:
return " HiperSockets";
case QETH_CARD_TYPE_OSN:
return " OSN QDIO";
default:
return " unknown";
}
Expand Down Expand Up @@ -153,6 +161,8 @@ qeth_get_cardname_short(struct qeth_card *card)
}
case QETH_CARD_TYPE_IQD:
return "HiperSockets";
case QETH_CARD_TYPE_OSN:
return "OSN";
default:
return "unknown";
}
Expand Down
Loading

0 comments on commit 500f83a

Please sign in to comment.