Commit a8c7629c authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: remove OSN support

Commit fb64de1b ("s390/qeth: phase out OSN support") spelled out
why the OSN support in qeth is in a bad shape, and put any remaining
interested parties on notice to speak up before it gets ripped out.

It's 2021 now, so make true on that promise and remove all the
OSN-specific parts from qeth. This also means that we no longer need to
export various parts of the cmd & data path internals to the L2 driver.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc672d49
...@@ -53,8 +53,6 @@ extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver); ...@@ -53,8 +53,6 @@ extern int ccwgroup_driver_register (struct ccwgroup_driver *cdriver);
extern void ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver); extern void ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver);
int ccwgroup_create_dev(struct device *root, struct ccwgroup_driver *gdrv, int ccwgroup_create_dev(struct device *root, struct ccwgroup_driver *gdrv,
int num_devices, const char *buf); int num_devices, const char *buf);
struct ccwgroup_device *get_ccwgroupdev_by_busid(struct ccwgroup_driver *gdrv,
char *bus_id);
extern int ccwgroup_set_online(struct ccwgroup_device *gdev); extern int ccwgroup_set_online(struct ccwgroup_device *gdev);
extern int ccwgroup_set_offline(struct ccwgroup_device *gdev); extern int ccwgroup_set_offline(struct ccwgroup_device *gdev);
......
...@@ -503,28 +503,6 @@ void ccwgroup_driver_unregister(struct ccwgroup_driver *cdriver) ...@@ -503,28 +503,6 @@ void ccwgroup_driver_unregister(struct ccwgroup_driver *cdriver)
} }
EXPORT_SYMBOL(ccwgroup_driver_unregister); EXPORT_SYMBOL(ccwgroup_driver_unregister);
/**
* get_ccwgroupdev_by_busid() - obtain device from a bus id
* @gdrv: driver the device is owned by
* @bus_id: bus id of the device to be searched
*
* This function searches all devices owned by @gdrv for a device with a bus
* id matching @bus_id.
* Returns:
* If a match is found, its reference count of the found device is increased
* and it is returned; else %NULL is returned.
*/
struct ccwgroup_device *get_ccwgroupdev_by_busid(struct ccwgroup_driver *gdrv,
char *bus_id)
{
struct device *dev;
dev = driver_find_device_by_name(&gdrv->driver, bus_id);
return dev ? to_ccwgroupdev(dev) : NULL;
}
EXPORT_SYMBOL_GPL(get_ccwgroupdev_by_busid);
/** /**
* ccwgroup_probe_ccwdev() - probe function for slave devices * ccwgroup_probe_ccwdev() - probe function for slave devices
* @cdev: ccw device to be probed * @cdev: ccw device to be probed
......
...@@ -88,15 +88,6 @@ config QETH_L3 ...@@ -88,15 +88,6 @@ config QETH_L3
To compile as a module choose M. The module name is qeth_l3. To compile as a module choose M. The module name is qeth_l3.
If unsure, choose Y. If unsure, choose Y.
config QETH_OSN
def_bool !HAVE_MARCH_Z14_FEATURES
prompt "qeth OSN device support"
depends on QETH
help
This enables the qeth driver to support devices in OSN mode.
This feature will be removed in 2021.
If unsure, choose N.
config QETH_OSX config QETH_OSX
def_bool !HAVE_MARCH_Z15_FEATURES def_bool !HAVE_MARCH_Z15_FEATURES
prompt "qeth OSX device support" prompt "qeth OSX device support"
......
...@@ -259,22 +259,10 @@ struct qeth_hdr_layer2 { ...@@ -259,22 +259,10 @@ struct qeth_hdr_layer2 {
__u8 reserved2[16]; __u8 reserved2[16];
} __attribute__ ((packed)); } __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 { struct qeth_hdr {
union { union {
struct qeth_hdr_layer2 l2; struct qeth_hdr_layer2 l2;
struct qeth_hdr_layer3 l3; struct qeth_hdr_layer3 l3;
struct qeth_hdr_osn osn;
} hdr; } hdr;
} __attribute__ ((packed)); } __attribute__ ((packed));
...@@ -341,7 +329,6 @@ enum qeth_header_ids { ...@@ -341,7 +329,6 @@ enum qeth_header_ids {
QETH_HEADER_TYPE_LAYER3 = 0x01, QETH_HEADER_TYPE_LAYER3 = 0x01,
QETH_HEADER_TYPE_LAYER2 = 0x02, QETH_HEADER_TYPE_LAYER2 = 0x02,
QETH_HEADER_TYPE_L3_TSO = 0x03, QETH_HEADER_TYPE_L3_TSO = 0x03,
QETH_HEADER_TYPE_OSN = 0x04,
QETH_HEADER_TYPE_L2_TSO = 0x06, QETH_HEADER_TYPE_L2_TSO = 0x06,
QETH_HEADER_MASK_INVAL = 0x80, QETH_HEADER_MASK_INVAL = 0x80,
}; };
...@@ -779,11 +766,6 @@ enum qeth_threads { ...@@ -779,11 +766,6 @@ enum qeth_threads {
QETH_RECOVER_THREAD = 1, QETH_RECOVER_THREAD = 1,
}; };
struct qeth_osn_info {
int (*assist_cb)(struct net_device *dev, void *data);
int (*data_cb)(struct sk_buff *skb);
};
struct qeth_discipline { struct qeth_discipline {
const struct device_type *devtype; const struct device_type *devtype;
int (*setup) (struct ccwgroup_device *); int (*setup) (struct ccwgroup_device *);
...@@ -865,7 +847,6 @@ struct qeth_card { ...@@ -865,7 +847,6 @@ struct qeth_card {
/* QDIO buffer handling */ /* QDIO buffer handling */
struct qeth_qdio_info qdio; struct qeth_qdio_info qdio;
int read_or_write_problem; int read_or_write_problem;
struct qeth_osn_info osn_info;
const struct qeth_discipline *discipline; const struct qeth_discipline *discipline;
atomic_t force_alloc_skb; atomic_t force_alloc_skb;
struct service_level qeth_service_level; struct service_level qeth_service_level;
...@@ -1058,9 +1039,7 @@ int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb); ...@@ -1058,9 +1039,7 @@ int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb);
extern const struct qeth_discipline qeth_l2_discipline; extern const struct qeth_discipline qeth_l2_discipline;
extern const struct qeth_discipline qeth_l3_discipline; extern const struct qeth_discipline qeth_l3_discipline;
extern const struct ethtool_ops qeth_ethtool_ops; extern const struct ethtool_ops qeth_ethtool_ops;
extern const struct ethtool_ops qeth_osn_ethtool_ops;
extern const struct attribute_group *qeth_dev_groups[]; extern const struct attribute_group *qeth_dev_groups[];
extern const struct attribute_group *qeth_osn_dev_groups[];
extern const struct device_type qeth_generic_devtype; extern const struct device_type qeth_generic_devtype;
const char *qeth_get_cardname_short(struct qeth_card *); const char *qeth_get_cardname_short(struct qeth_card *);
...@@ -1069,11 +1048,9 @@ int qeth_setup_discipline(struct qeth_card *card, enum qeth_discipline_id disc); ...@@ -1069,11 +1048,9 @@ int qeth_setup_discipline(struct qeth_card *card, enum qeth_discipline_id disc);
void qeth_remove_discipline(struct qeth_card *card); void qeth_remove_discipline(struct qeth_card *card);
/* exports for qeth discipline device drivers */ /* exports for qeth discipline device drivers */
extern struct kmem_cache *qeth_core_header_cache;
extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS]; extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS];
struct net_device *qeth_clone_netdev(struct net_device *orig); struct net_device *qeth_clone_netdev(struct net_device *orig);
struct qeth_card *qeth_get_card_by_busid(char *bus_id);
void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads, void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads,
int clear_start_mask); int clear_start_mask);
int qeth_threads_running(struct qeth_card *, unsigned long); int qeth_threads_running(struct qeth_card *, unsigned long);
...@@ -1088,9 +1065,6 @@ struct qeth_cmd_buffer *qeth_ipa_alloc_cmd(struct qeth_card *card, ...@@ -1088,9 +1065,6 @@ struct qeth_cmd_buffer *qeth_ipa_alloc_cmd(struct qeth_card *card,
enum qeth_ipa_cmds cmd_code, enum qeth_ipa_cmds cmd_code,
enum qeth_prot_versions prot, enum qeth_prot_versions prot,
unsigned int data_length); unsigned int data_length);
struct qeth_cmd_buffer *qeth_alloc_cmd(struct qeth_channel *channel,
unsigned int length, unsigned int ccws,
long timeout);
struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *card, struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *card,
enum qeth_ipa_funcs ipa_func, enum qeth_ipa_funcs ipa_func,
u16 cmd_code, u16 cmd_code,
...@@ -1099,18 +1073,12 @@ struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *card, ...@@ -1099,18 +1073,12 @@ struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *card,
struct qeth_cmd_buffer *qeth_get_diag_cmd(struct qeth_card *card, struct qeth_cmd_buffer *qeth_get_diag_cmd(struct qeth_card *card,
enum qeth_diags_cmds sub_cmd, enum qeth_diags_cmds sub_cmd,
unsigned int data_length); unsigned int data_length);
void qeth_notify_cmd(struct qeth_cmd_buffer *iob, int reason);
void qeth_put_cmd(struct qeth_cmd_buffer *iob);
int qeth_schedule_recovery(struct qeth_card *card); int qeth_schedule_recovery(struct qeth_card *card);
int qeth_poll(struct napi_struct *napi, int budget); int qeth_poll(struct napi_struct *napi, int budget);
void qeth_setadp_promisc_mode(struct qeth_card *card, bool enable); void qeth_setadp_promisc_mode(struct qeth_card *card, bool enable);
int qeth_setadpparms_change_macaddr(struct qeth_card *); int qeth_setadpparms_change_macaddr(struct qeth_card *);
void qeth_tx_timeout(struct net_device *, unsigned int txqueue); void qeth_tx_timeout(struct net_device *, unsigned int txqueue);
void qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
u16 cmd_length,
bool (*match)(struct qeth_cmd_buffer *iob,
struct qeth_cmd_buffer *reply));
int qeth_query_switch_attributes(struct qeth_card *card, int qeth_query_switch_attributes(struct qeth_card *card,
struct qeth_switch_info *sw_info); struct qeth_switch_info *sw_info);
int qeth_query_card_info(struct qeth_card *card, int qeth_query_card_info(struct qeth_card *card,
...@@ -1118,11 +1086,6 @@ int qeth_query_card_info(struct qeth_card *card, ...@@ -1118,11 +1086,6 @@ int qeth_query_card_info(struct qeth_card *card,
int qeth_setadpparms_set_access_ctrl(struct qeth_card *card, int qeth_setadpparms_set_access_ctrl(struct qeth_card *card,
enum qeth_ipa_isolation_modes mode); enum qeth_ipa_isolation_modes mode);
unsigned int qeth_count_elements(struct sk_buff *skb, unsigned int data_offset);
int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
struct sk_buff *skb, struct qeth_hdr *hdr,
unsigned int offset, unsigned int hd_len,
int elements_needed);
int qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); int qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...); void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...);
int qeth_configure_cq(struct qeth_card *, enum qeth_cq); int qeth_configure_cq(struct qeth_card *, enum qeth_cq);
...@@ -1148,11 +1111,4 @@ int qeth_xmit(struct qeth_card *card, struct sk_buff *skb, ...@@ -1148,11 +1111,4 @@ int qeth_xmit(struct qeth_card *card, struct sk_buff *skb,
struct qeth_hdr *hdr, struct sk_buff *skb, struct qeth_hdr *hdr, struct sk_buff *skb,
__be16 proto, unsigned int data_len)); __be16 proto, unsigned int data_len));
/* exports for OSN */
int qeth_osn_assist(struct net_device *, void *, int);
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 *));
void qeth_osn_deregister(struct net_device *);
#endif /* __QETH_CORE_H__ */ #endif /* __QETH_CORE_H__ */
This diff is collapsed.
...@@ -232,9 +232,6 @@ static const struct ipa_cmd_names qeth_ipa_cmd_names[] = { ...@@ -232,9 +232,6 @@ static const struct ipa_cmd_names qeth_ipa_cmd_names[] = {
{IPA_CMD_DELVLAN, "delvlan"}, {IPA_CMD_DELVLAN, "delvlan"},
{IPA_CMD_VNICC, "vnic_characteristics"}, {IPA_CMD_VNICC, "vnic_characteristics"},
{IPA_CMD_SETBRIDGEPORT_OSA, "set_bridge_port(osa)"}, {IPA_CMD_SETBRIDGEPORT_OSA, "set_bridge_port(osa)"},
{IPA_CMD_SETCCID, "setccid"},
{IPA_CMD_DELCCID, "delccid"},
{IPA_CMD_MODCCID, "modccid"},
{IPA_CMD_SETIP, "setip"}, {IPA_CMD_SETIP, "setip"},
{IPA_CMD_QIPASSIST, "qipassist"}, {IPA_CMD_QIPASSIST, "qipassist"},
{IPA_CMD_SETASSPARMS, "setassparms"}, {IPA_CMD_SETASSPARMS, "setassparms"},
......
...@@ -34,8 +34,6 @@ extern const unsigned char IPA_PDU_HEADER[]; ...@@ -34,8 +34,6 @@ extern const unsigned char IPA_PDU_HEADER[];
/*****************************************************************************/ /*****************************************************************************/
#define IPA_CMD_INITIATOR_HOST 0x00 #define IPA_CMD_INITIATOR_HOST 0x00
#define IPA_CMD_INITIATOR_OSA 0x01 #define IPA_CMD_INITIATOR_OSA 0x01
#define IPA_CMD_INITIATOR_HOST_REPLY 0x80
#define IPA_CMD_INITIATOR_OSA_REPLY 0x81
#define IPA_CMD_PRIM_VERSION_NO 0x01 #define IPA_CMD_PRIM_VERSION_NO 0x01
struct qeth_ipa_caps { struct qeth_ipa_caps {
...@@ -66,7 +64,6 @@ static inline bool qeth_ipa_caps_enabled(struct qeth_ipa_caps *caps, u32 mask) ...@@ -66,7 +64,6 @@ static inline bool qeth_ipa_caps_enabled(struct qeth_ipa_caps *caps, u32 mask)
enum qeth_card_types { enum qeth_card_types {
QETH_CARD_TYPE_OSD = 1, QETH_CARD_TYPE_OSD = 1,
QETH_CARD_TYPE_IQD = 5, QETH_CARD_TYPE_IQD = 5,
QETH_CARD_TYPE_OSN = 6,
QETH_CARD_TYPE_OSM = 3, QETH_CARD_TYPE_OSM = 3,
QETH_CARD_TYPE_OSX = 2, QETH_CARD_TYPE_OSX = 2,
}; };
...@@ -75,12 +72,6 @@ enum qeth_card_types { ...@@ -75,12 +72,6 @@ enum qeth_card_types {
#define IS_OSD(card) ((card)->info.type == QETH_CARD_TYPE_OSD) #define IS_OSD(card) ((card)->info.type == QETH_CARD_TYPE_OSD)
#define IS_OSM(card) ((card)->info.type == QETH_CARD_TYPE_OSM) #define IS_OSM(card) ((card)->info.type == QETH_CARD_TYPE_OSM)
#ifdef CONFIG_QETH_OSN
#define IS_OSN(card) ((card)->info.type == QETH_CARD_TYPE_OSN)
#else
#define IS_OSN(card) false
#endif
#ifdef CONFIG_QETH_OSX #ifdef CONFIG_QETH_OSX
#define IS_OSX(card) ((card)->info.type == QETH_CARD_TYPE_OSX) #define IS_OSX(card) ((card)->info.type == QETH_CARD_TYPE_OSX)
#else #else
...@@ -95,7 +86,6 @@ enum qeth_link_types { ...@@ -95,7 +86,6 @@ enum qeth_link_types {
QETH_LINK_TYPE_FAST_ETH = 0x01, QETH_LINK_TYPE_FAST_ETH = 0x01,
QETH_LINK_TYPE_HSTR = 0x02, QETH_LINK_TYPE_HSTR = 0x02,
QETH_LINK_TYPE_GBIT_ETH = 0x03, QETH_LINK_TYPE_GBIT_ETH = 0x03,
QETH_LINK_TYPE_OSN = 0x04,
QETH_LINK_TYPE_10GBIT_ETH = 0x10, QETH_LINK_TYPE_10GBIT_ETH = 0x10,
QETH_LINK_TYPE_25GBIT_ETH = 0x12, QETH_LINK_TYPE_25GBIT_ETH = 0x12,
QETH_LINK_TYPE_LANE_ETH100 = 0x81, QETH_LINK_TYPE_LANE_ETH100 = 0x81,
...@@ -126,9 +116,6 @@ enum qeth_ipa_cmds { ...@@ -126,9 +116,6 @@ enum qeth_ipa_cmds {
IPA_CMD_DELVLAN = 0x26, IPA_CMD_DELVLAN = 0x26,
IPA_CMD_VNICC = 0x2a, IPA_CMD_VNICC = 0x2a,
IPA_CMD_SETBRIDGEPORT_OSA = 0x2b, IPA_CMD_SETBRIDGEPORT_OSA = 0x2b,
IPA_CMD_SETCCID = 0x41,
IPA_CMD_DELCCID = 0x42,
IPA_CMD_MODCCID = 0x43,
IPA_CMD_SETIP = 0xb1, IPA_CMD_SETIP = 0xb1,
IPA_CMD_QIPASSIST = 0xb2, IPA_CMD_QIPASSIST = 0xb2,
IPA_CMD_SETASSPARMS = 0xb3, IPA_CMD_SETASSPARMS = 0xb3,
...@@ -879,8 +866,7 @@ extern const char *qeth_get_ipa_msg(enum qeth_ipa_return_codes rc); ...@@ -879,8 +866,7 @@ extern const char *qeth_get_ipa_msg(enum qeth_ipa_return_codes rc);
extern const char *qeth_get_ipa_cmd_name(enum qeth_ipa_cmds cmd); extern const char *qeth_get_ipa_cmd_name(enum qeth_ipa_cmds cmd);
/* Helper functions */ /* Helper functions */
#define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \ #define IS_IPA_REPLY(cmd) ((cmd)->hdr.initiator == IPA_CMD_INITIATOR_HOST)
(cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY))
/*****************************************************************************/ /*****************************************************************************/
/* END OF IP Assist related definitions */ /* END OF IP Assist related definitions */
...@@ -922,7 +908,6 @@ extern const unsigned char ULP_ENABLE[]; ...@@ -922,7 +908,6 @@ extern const unsigned char ULP_ENABLE[];
/* Layer 2 definitions */ /* Layer 2 definitions */
#define QETH_PROT_LAYER2 0x08 #define QETH_PROT_LAYER2 0x08
#define QETH_PROT_TCPIP 0x03 #define QETH_PROT_TCPIP 0x03
#define QETH_PROT_OSN2 0x0a
#define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer + 0x50) #define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer + 0x50)
#define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer + 0x19) #define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer + 0x19)
......
...@@ -671,11 +671,6 @@ static const struct attribute_group qeth_dev_group = { ...@@ -671,11 +671,6 @@ static const struct attribute_group qeth_dev_group = {
.attrs = qeth_dev_attrs, .attrs = qeth_dev_attrs,
}; };
const struct attribute_group *qeth_osn_dev_groups[] = {
&qeth_dev_group,
NULL,
};
const struct attribute_group *qeth_dev_groups[] = { const struct attribute_group *qeth_dev_groups[] = {
&qeth_dev_group, &qeth_dev_group,
&qeth_dev_extended_group, &qeth_dev_extended_group,
......
...@@ -469,10 +469,3 @@ const struct ethtool_ops qeth_ethtool_ops = { ...@@ -469,10 +469,3 @@ const struct ethtool_ops qeth_ethtool_ops = {
.set_per_queue_coalesce = qeth_set_per_queue_coalesce, .set_per_queue_coalesce = qeth_set_per_queue_coalesce,
.get_link_ksettings = qeth_get_link_ksettings, .get_link_ksettings = qeth_get_link_ksettings,
}; };
const struct ethtool_ops qeth_osn_ethtool_ops = {
.get_strings = qeth_get_strings,
.get_ethtool_stats = qeth_get_ethtool_stats,
.get_sset_count = qeth_get_sset_count,
.get_drvinfo = qeth_get_drvinfo,
};
...@@ -309,17 +309,16 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card) ...@@ -309,17 +309,16 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
/* fall back to alternative mechanism: */ /* fall back to alternative mechanism: */
} }
if (!IS_OSN(card)) { rc = qeth_setadpparms_change_macaddr(card);
rc = qeth_setadpparms_change_macaddr(card); if (!rc)
if (!rc) goto out;
goto out; QETH_DBF_MESSAGE(2, "READ_MAC Assist failed on device %x: %#x\n",
QETH_DBF_MESSAGE(2, "READ_MAC Assist failed on device %x: %#x\n", CARD_DEVID(card), rc);
CARD_DEVID(card), rc); QETH_CARD_TEXT_(card, 2, "1err%04x", rc);
QETH_CARD_TEXT_(card, 2, "1err%04x", rc);
/* fall back once more: */
}
/* some devices don't support a custom MAC address: */ /* Fall back once more, but some devices don't support a custom MAC
* address:
*/
if (IS_OSM(card) || IS_OSX(card)) if (IS_OSM(card) || IS_OSX(card))
return (rc) ? rc : -EADDRNOTAVAIL; return (rc) ? rc : -EADDRNOTAVAIL;
eth_hw_addr_random(card->dev); eth_hw_addr_random(card->dev);
...@@ -334,7 +333,7 @@ static void qeth_l2_register_dev_addr(struct qeth_card *card) ...@@ -334,7 +333,7 @@ static void qeth_l2_register_dev_addr(struct qeth_card *card)
if (!is_valid_ether_addr(card->dev->dev_addr)) if (!is_valid_ether_addr(card->dev->dev_addr))
qeth_l2_request_initial_mac(card); qeth_l2_request_initial_mac(card);
if (!IS_OSN(card) && !qeth_l2_send_setmac(card, card->dev->dev_addr)) if (!qeth_l2_send_setmac(card, card->dev->dev_addr))
card->info.dev_addr_is_registered = 1; card->info.dev_addr_is_registered = 1;
else else
card->info.dev_addr_is_registered = 0; card->info.dev_addr_is_registered = 0;
...@@ -496,44 +495,6 @@ static void qeth_l2_rx_mode_work(struct work_struct *work) ...@@ -496,44 +495,6 @@ static void qeth_l2_rx_mode_work(struct work_struct *work)
qeth_l2_set_promisc_mode(card); qeth_l2_set_promisc_mode(card);
} }
static int qeth_l2_xmit_osn(struct qeth_card *card, struct sk_buff *skb,
struct qeth_qdio_out_q *queue)
{
gfp_t gfp = GFP_ATOMIC | (skb_pfmemalloc(skb) ? __GFP_MEMALLOC : 0);
struct qeth_hdr *hdr = (struct qeth_hdr *)skb->data;
addr_t end = (addr_t)(skb->data + sizeof(*hdr));
addr_t start = (addr_t)skb->data;
unsigned int elements = 0;
unsigned int hd_len = 0;
int rc;
if (skb->protocol == htons(ETH_P_IPV6))
return -EPROTONOSUPPORT;
if (qeth_get_elements_for_range(start, end) > 1) {
/* Misaligned HW header, move it to its own buffer element. */
hdr = kmem_cache_alloc(qeth_core_header_cache, gfp);
if (!hdr)
return -ENOMEM;
hd_len = sizeof(*hdr);
skb_copy_from_linear_data(skb, (char *)hdr, hd_len);
elements++;
}
elements += qeth_count_elements(skb, hd_len);
if (elements > queue->max_elements) {
rc = -E2BIG;
goto out;
}
rc = qeth_do_send_packet(card, queue, skb, hdr, hd_len, hd_len,
elements);
out:
if (rc && hd_len)
kmem_cache_free(qeth_core_header_cache, hdr);
return rc;
}
static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb, static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb,
struct net_device *dev) struct net_device *dev)
{ {
...@@ -548,12 +509,8 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb, ...@@ -548,12 +509,8 @@ static netdev_tx_t qeth_l2_hard_start_xmit(struct sk_buff *skb,
txq = qeth_iqd_translate_txq(dev, txq); txq = qeth_iqd_translate_txq(dev, txq);
queue = card->qdio.out_qs[txq]; queue = card->qdio.out_qs[txq];
if (IS_OSN(card)) rc = qeth_xmit(card, skb, queue, vlan_get_protocol(skb),
rc = qeth_l2_xmit_osn(card, skb, queue); qeth_l2_fill_header);
else
rc = qeth_xmit(card, skb, queue, vlan_get_protocol(skb),
qeth_l2_fill_header);
if (!rc) if (!rc)
return NETDEV_TX_OK; return NETDEV_TX_OK;
...@@ -890,23 +847,8 @@ static const struct net_device_ops qeth_l2_netdev_ops = { ...@@ -890,23 +847,8 @@ static const struct net_device_ops qeth_l2_netdev_ops = {
.ndo_bridge_setlink = qeth_l2_bridge_setlink, .ndo_bridge_setlink = qeth_l2_bridge_setlink,
}; };
static const struct net_device_ops qeth_osn_netdev_ops = {
.ndo_open = qeth_open,
.ndo_stop = qeth_stop,
.ndo_get_stats64 = qeth_get_stats64,
.ndo_start_xmit = qeth_l2_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_tx_timeout = qeth_tx_timeout,
};
static int qeth_l2_setup_netdev(struct qeth_card *card) static int qeth_l2_setup_netdev(struct qeth_card *card)
{ {
if (IS_OSN(card)) {
card->dev->netdev_ops = &qeth_osn_netdev_ops;
card->dev->flags |= IFF_NOARP;
goto add_napi;
}
card->dev->needed_headroom = sizeof(struct qeth_hdr); card->dev->needed_headroom = sizeof(struct qeth_hdr);
card->dev->netdev_ops = &qeth_l2_netdev_ops; card->dev->netdev_ops = &qeth_l2_netdev_ops;
card->dev->priv_flags |= IFF_UNICAST_FLT; card->dev->priv_flags |= IFF_UNICAST_FLT;
...@@ -952,7 +894,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card) ...@@ -952,7 +894,6 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
PAGE_SIZE * (QDIO_MAX_ELEMENTS_PER_BUFFER - 1)); PAGE_SIZE * (QDIO_MAX_ELEMENTS_PER_BUFFER - 1));
} }
add_napi:
netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT); netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT);
return register_netdev(card->dev); return register_netdev(card->dev);
} }
...@@ -1044,84 +985,6 @@ static void qeth_l2_enable_brport_features(struct qeth_card *card) ...@@ -1044,84 +985,6 @@ static void qeth_l2_enable_brport_features(struct qeth_card *card)
} }
} }
#ifdef CONFIG_QETH_OSN
static void qeth_osn_assist_cb(struct qeth_card *card,
struct qeth_cmd_buffer *iob,
unsigned int data_length)
{
qeth_notify_cmd(iob, 0);
qeth_put_cmd(iob);
}
int qeth_osn_assist(struct net_device *dev, void *data, int data_len)
{
struct qeth_cmd_buffer *iob;
struct qeth_card *card;
if (data_len < 0)
return -EINVAL;
if (!dev)
return -ENODEV;
card = dev->ml_priv;
if (!card)
return -ENODEV;
QETH_CARD_TEXT(card, 2, "osnsdmc");
if (!qeth_card_hw_is_reachable(card))
return -ENODEV;
iob = qeth_alloc_cmd(&card->write, IPA_PDU_HEADER_SIZE + data_len, 1,
QETH_IPA_TIMEOUT);
if (!iob)
return -ENOMEM;
qeth_prepare_ipa_cmd(card, iob, (u16) data_len, NULL);
memcpy(__ipa_cmd(iob), data, data_len);
iob->callback = qeth_osn_assist_cb;
return qeth_send_ipa_cmd(card, iob, NULL, NULL);
}
EXPORT_SYMBOL(qeth_osn_assist);
int qeth_osn_register(unsigned char *read_dev_no, struct net_device **dev,
int (*assist_cb)(struct net_device *, void *),
int (*data_cb)(struct sk_buff *))
{
struct qeth_card *card;
char bus_id[16];
u16 devno;
memcpy(&devno, read_dev_no, 2);
sprintf(bus_id, "0.0.%04x", devno);
card = qeth_get_card_by_busid(bus_id);
if (!card || !IS_OSN(card))
return -ENODEV;
*dev = card->dev;
QETH_CARD_TEXT(card, 2, "osnreg");
if ((assist_cb == NULL) || (data_cb == NULL))
return -EINVAL;
card->osn_info.assist_cb = assist_cb;
card->osn_info.data_cb = data_cb;
return 0;
}
EXPORT_SYMBOL(qeth_osn_register);
void qeth_osn_deregister(struct net_device *dev)
{
struct qeth_card *card;
if (!dev)
return;
card = dev->ml_priv;
if (!card)
return;
QETH_CARD_TEXT(card, 2, "osndereg");
card->osn_info.assist_cb = NULL;
card->osn_info.data_cb = NULL;
}
EXPORT_SYMBOL(qeth_osn_deregister);
#endif
/* SETBRIDGEPORT support, async notifications */ /* SETBRIDGEPORT support, async notifications */
enum qeth_an_event_type {anev_reg_unreg, anev_abort, anev_reset}; enum qeth_an_event_type {anev_reg_unreg, anev_abort, anev_reset};
...@@ -2190,9 +2053,6 @@ static int qeth_l2_probe_device(struct ccwgroup_device *gdev) ...@@ -2190,9 +2053,6 @@ static int qeth_l2_probe_device(struct ccwgroup_device *gdev)
struct qeth_card *card = dev_get_drvdata(&gdev->dev); struct qeth_card *card = dev_get_drvdata(&gdev->dev);
int rc; int rc;
if (IS_OSN(card))
dev_notice(&gdev->dev, "OSN support will be dropped in 2021\n");
qeth_l2_vnicc_set_defaults(card); qeth_l2_vnicc_set_defaults(card);
mutex_init(&card->sbp_lock); mutex_init(&card->sbp_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment