Commit f9a94f85 authored by David S. Miller's avatar David S. Miller

Merge branch 's390-qeth-next'

Julian Wiedmann says:

====================
s390/qeth: updates 2019-06-11

please apply the following patch series for qeth to net-next.
This brings all sorts of cleanups and minor improvements,
primarily for the control IO path.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 11817aa6 d9b9f40b
...@@ -537,8 +537,6 @@ enum qeth_channel_states { ...@@ -537,8 +537,6 @@ enum qeth_channel_states {
CH_STATE_DOWN, CH_STATE_DOWN,
CH_STATE_HALTED, CH_STATE_HALTED,
CH_STATE_STOPPED, CH_STATE_STOPPED,
CH_STATE_RCD,
CH_STATE_RCD_DONE,
}; };
/** /**
* card state machine * card state machine
...@@ -560,6 +558,7 @@ enum qeth_prot_versions { ...@@ -560,6 +558,7 @@ enum qeth_prot_versions {
enum qeth_cmd_buffer_state { enum qeth_cmd_buffer_state {
BUF_STATE_FREE, BUF_STATE_FREE,
BUF_STATE_LOCKED, BUF_STATE_LOCKED,
BUF_STATE_MALLOC,
}; };
enum qeth_cq { enum qeth_cq {
...@@ -579,16 +578,22 @@ struct qeth_channel; ...@@ -579,16 +578,22 @@ struct qeth_channel;
struct qeth_cmd_buffer { struct qeth_cmd_buffer {
enum qeth_cmd_buffer_state state; enum qeth_cmd_buffer_state state;
unsigned int length;
refcount_t ref_count;
struct qeth_channel *channel; struct qeth_channel *channel;
struct qeth_reply *reply; struct qeth_reply *reply;
long timeout; long timeout;
unsigned char *data; unsigned char *data;
void (*finalize)(struct qeth_card *card, struct qeth_cmd_buffer *iob, void (*finalize)(struct qeth_card *card, struct qeth_cmd_buffer *iob,
unsigned int length); unsigned int length);
void (*callback)(struct qeth_card *card, struct qeth_channel *channel, void (*callback)(struct qeth_card *card, struct qeth_cmd_buffer *iob);
struct qeth_cmd_buffer *iob);
}; };
static inline void qeth_get_cmd(struct qeth_cmd_buffer *iob)
{
refcount_inc(&iob->ref_count);
}
static inline struct qeth_ipa_cmd *__ipa_cmd(struct qeth_cmd_buffer *iob) static inline struct qeth_ipa_cmd *__ipa_cmd(struct qeth_cmd_buffer *iob)
{ {
return (struct qeth_ipa_cmd *)(iob->data + IPA_PDU_HEADER_SIZE); return (struct qeth_ipa_cmd *)(iob->data + IPA_PDU_HEADER_SIZE);
...@@ -609,6 +614,13 @@ struct qeth_channel { ...@@ -609,6 +614,13 @@ struct qeth_channel {
int io_buf_no; int io_buf_no;
}; };
static inline struct ccw1 *__ccw_from_cmd(struct qeth_cmd_buffer *iob)
{
if (iob->state != BUF_STATE_MALLOC)
return iob->channel->ccw;
return (struct ccw1 *)(iob->data + ALIGN(iob->length, 8));
}
static inline bool qeth_trylock_channel(struct qeth_channel *channel) static inline bool qeth_trylock_channel(struct qeth_channel *channel)
{ {
return atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0; return atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0;
...@@ -665,6 +677,7 @@ struct qeth_card_info { ...@@ -665,6 +677,7 @@ struct qeth_card_info {
__u16 func_level; __u16 func_level;
char mcl_level[QETH_MCL_LENGTH + 1]; char mcl_level[QETH_MCL_LENGTH + 1];
u8 open_when_online:1; u8 open_when_online:1;
u8 use_v1_blkt:1;
u8 is_vm_nic:1; u8 is_vm_nic:1;
int mac_bits; int mac_bits;
enum qeth_card_types type; enum qeth_card_types type;
...@@ -764,6 +777,7 @@ struct qeth_card { ...@@ -764,6 +777,7 @@ struct qeth_card {
enum qeth_card_states state; enum qeth_card_states state;
spinlock_t lock; spinlock_t lock;
struct ccwgroup_device *gdev; struct ccwgroup_device *gdev;
struct qeth_cmd_buffer *read_cmd;
struct qeth_channel read; struct qeth_channel read;
struct qeth_channel write; struct qeth_channel write;
struct qeth_channel data; struct qeth_channel data;
...@@ -994,10 +1008,11 @@ void qeth_drain_output_queues(struct qeth_card *card); ...@@ -994,10 +1008,11 @@ void qeth_drain_output_queues(struct qeth_card *card);
void qeth_setadp_promisc_mode(struct qeth_card *); void qeth_setadp_promisc_mode(struct qeth_card *);
int qeth_setadpparms_change_macaddr(struct qeth_card *); int qeth_setadpparms_change_macaddr(struct qeth_card *);
void qeth_tx_timeout(struct net_device *); void qeth_tx_timeout(struct net_device *);
void qeth_release_buffer(struct qeth_channel *, struct qeth_cmd_buffer *); void qeth_release_buffer(struct qeth_cmd_buffer *iob);
void qeth_notify_reply(struct qeth_reply *reply, int reason);
void qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, void qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
u16 cmd_length); u16 cmd_length);
struct qeth_cmd_buffer *qeth_wait_for_buffer(struct qeth_channel *); struct qeth_cmd_buffer *qeth_get_buffer(struct qeth_channel *channel);
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,
......
This diff is collapsed.
...@@ -31,14 +31,12 @@ extern unsigned char IPA_PDU_HEADER[]; ...@@ -31,14 +31,12 @@ extern unsigned char IPA_PDU_HEADER[];
#define QETH_CLEAR_CHANNEL_PARM -10 #define QETH_CLEAR_CHANNEL_PARM -10
#define QETH_HALT_CHANNEL_PARM -11 #define QETH_HALT_CHANNEL_PARM -11
#define QETH_RCD_PARM -12
static inline bool qeth_intparm_is_iob(unsigned long intparm) static inline bool qeth_intparm_is_iob(unsigned long intparm)
{ {
switch (intparm) { switch (intparm) {
case QETH_CLEAR_CHANNEL_PARM: case QETH_CLEAR_CHANNEL_PARM:
case QETH_HALT_CHANNEL_PARM: case QETH_HALT_CHANNEL_PARM:
case QETH_RCD_PARM:
case 0: case 0:
return false; return false;
} }
......
...@@ -274,8 +274,7 @@ static int qeth_l2_vlan_rx_kill_vid(struct net_device *dev, ...@@ -274,8 +274,7 @@ static int qeth_l2_vlan_rx_kill_vid(struct net_device *dev,
static void qeth_l2_stop_card(struct qeth_card *card) static void qeth_l2_stop_card(struct qeth_card *card)
{ {
QETH_DBF_TEXT(SETUP , 2, "stopcard"); QETH_CARD_TEXT(card, 2, "stopcard");
QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *));
qeth_set_allowed_threads(card, 0, 1); qeth_set_allowed_threads(card, 0, 1);
...@@ -292,11 +291,8 @@ static void qeth_l2_stop_card(struct qeth_card *card) ...@@ -292,11 +291,8 @@ static void qeth_l2_stop_card(struct qeth_card *card)
qeth_clear_working_pool_list(card); qeth_clear_working_pool_list(card);
card->state = CARD_STATE_DOWN; card->state = CARD_STATE_DOWN;
} }
if (card->state == CARD_STATE_DOWN) {
qeth_clear_cmd_buffers(&card->read);
qeth_clear_cmd_buffers(&card->write);
}
qeth_clear_cmd_buffers(&card->write);
flush_workqueue(card->event_wq); flush_workqueue(card->event_wq);
card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED; card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED;
} }
...@@ -354,8 +350,7 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card) ...@@ -354,8 +350,7 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
{ {
int rc = 0; int rc = 0;
QETH_DBF_TEXT(SETUP, 2, "l2reqmac"); QETH_CARD_TEXT(card, 2, "l2reqmac");
QETH_DBF_TEXT_(SETUP, 2, "doL2%s", CARD_BUS_ID(card));
if (MACHINE_IS_VM) { if (MACHINE_IS_VM) {
rc = qeth_vm_request_mac(card); rc = qeth_vm_request_mac(card);
...@@ -363,7 +358,7 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card) ...@@ -363,7 +358,7 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
goto out; goto out;
QETH_DBF_MESSAGE(2, "z/VM MAC Service failed on device %x: %#x\n", QETH_DBF_MESSAGE(2, "z/VM MAC Service failed on device %x: %#x\n",
CARD_DEVID(card), rc); CARD_DEVID(card), rc);
QETH_DBF_TEXT_(SETUP, 2, "err%04x", rc); QETH_CARD_TEXT_(card, 2, "err%04x", rc);
/* fall back to alternative mechanism: */ /* fall back to alternative mechanism: */
} }
...@@ -373,7 +368,7 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card) ...@@ -373,7 +368,7 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
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_DBF_TEXT_(SETUP, 2, "1err%04x", rc); QETH_CARD_TEXT_(card, 2, "1err%04x", rc);
/* fall back once more: */ /* fall back once more: */
} }
...@@ -383,7 +378,7 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card) ...@@ -383,7 +378,7 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
eth_hw_addr_random(card->dev); eth_hw_addr_random(card->dev);
out: out:
QETH_DBF_HEX(SETUP, 2, card->dev->dev_addr, card->dev->addr_len); QETH_CARD_HEX(card, 2, card->dev->dev_addr, card->dev->addr_len);
return 0; return 0;
} }
...@@ -467,7 +462,7 @@ static void qeth_promisc_to_bridge(struct qeth_card *card) ...@@ -467,7 +462,7 @@ static void qeth_promisc_to_bridge(struct qeth_card *card)
role = QETH_SBP_ROLE_NONE; role = QETH_SBP_ROLE_NONE;
rc = qeth_bridgeport_setrole(card, role); rc = qeth_bridgeport_setrole(card, role);
QETH_DBF_TEXT_(SETUP, 2, "bpm%c%04x", QETH_CARD_TEXT_(card, 2, "bpm%c%04x",
(promisc_mode == SET_PROMISC_MODE_ON) ? '+' : '-', rc); (promisc_mode == SET_PROMISC_MODE_ON) ? '+' : '-', rc);
if (!rc) { if (!rc) {
card->options.sbp.role = role; card->options.sbp.role = role;
...@@ -796,12 +791,11 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev) ...@@ -796,12 +791,11 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
mutex_lock(&card->discipline_mutex); mutex_lock(&card->discipline_mutex);
mutex_lock(&card->conf_mutex); mutex_lock(&card->conf_mutex);
QETH_DBF_TEXT(SETUP, 2, "setonlin"); QETH_CARD_TEXT(card, 2, "setonlin");
QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *));
rc = qeth_core_hardsetup_card(card, &carrier_ok); rc = qeth_core_hardsetup_card(card, &carrier_ok);
if (rc) { if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "2err%04x", rc); QETH_CARD_TEXT_(card, 2, "2err%04x", rc);
rc = -ENODEV; rc = -ENODEV;
goto out_remove; goto out_remove;
} }
...@@ -832,7 +826,7 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev) ...@@ -832,7 +826,7 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
qeth_print_status_message(card); qeth_print_status_message(card);
/* softsetup */ /* softsetup */
QETH_DBF_TEXT(SETUP, 2, "softsetp"); QETH_CARD_TEXT(card, 2, "softsetp");
if (IS_OSD(card) || IS_OSX(card)) { if (IS_OSD(card) || IS_OSX(card)) {
rc = qeth_l2_start_ipassists(card); rc = qeth_l2_start_ipassists(card);
...@@ -842,7 +836,7 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev) ...@@ -842,7 +836,7 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
rc = qeth_init_qdio_queues(card); rc = qeth_init_qdio_queues(card);
if (rc) { if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc); QETH_CARD_TEXT_(card, 2, "6err%d", rc);
rc = -ENODEV; rc = -ENODEV;
goto out_remove; goto out_remove;
} }
...@@ -882,7 +876,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev) ...@@ -882,7 +876,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
ccw_device_set_offline(CARD_WDEV(card)); ccw_device_set_offline(CARD_WDEV(card));
ccw_device_set_offline(CARD_RDEV(card)); ccw_device_set_offline(CARD_RDEV(card));
qdio_free(CARD_DDEV(card)); qdio_free(CARD_DDEV(card));
card->state = CARD_STATE_DOWN;
mutex_unlock(&card->conf_mutex); mutex_unlock(&card->conf_mutex);
mutex_unlock(&card->discipline_mutex); mutex_unlock(&card->discipline_mutex);
...@@ -897,8 +890,7 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev, ...@@ -897,8 +890,7 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev,
mutex_lock(&card->discipline_mutex); mutex_lock(&card->discipline_mutex);
mutex_lock(&card->conf_mutex); mutex_lock(&card->conf_mutex);
QETH_DBF_TEXT(SETUP, 3, "setoffl"); QETH_CARD_TEXT(card, 3, "setoffl");
QETH_DBF_HEX(SETUP, 3, &card, sizeof(void *));
if ((!recovery_mode && card->info.hwtrap) || card->info.hwtrap == 2) { if ((!recovery_mode && card->info.hwtrap) || card->info.hwtrap == 2) {
qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
...@@ -919,7 +911,7 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev, ...@@ -919,7 +911,7 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev,
if (!rc) if (!rc)
rc = (rc2) ? rc2 : rc3; rc = (rc2) ? rc2 : rc3;
if (rc) if (rc)
QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); QETH_CARD_TEXT_(card, 2, "1err%d", rc);
qdio_free(CARD_DDEV(card)); qdio_free(CARD_DDEV(card));
/* let user_space know that device is offline */ /* let user_space know that device is offline */
...@@ -1036,42 +1028,11 @@ struct qeth_discipline qeth_l2_discipline = { ...@@ -1036,42 +1028,11 @@ struct qeth_discipline qeth_l2_discipline = {
}; };
EXPORT_SYMBOL_GPL(qeth_l2_discipline); EXPORT_SYMBOL_GPL(qeth_l2_discipline);
static int qeth_osn_send_control_data(struct qeth_card *card, int len, static void qeth_osn_assist_cb(struct qeth_card *card,
struct qeth_cmd_buffer *iob) struct qeth_cmd_buffer *iob)
{ {
struct qeth_channel *channel = iob->channel; qeth_notify_reply(iob->reply, 0);
int rc = 0; qeth_release_buffer(iob);
QETH_CARD_TEXT(card, 5, "osndctrd");
wait_event(card->wait_q, qeth_trylock_channel(channel));
iob->finalize(card, iob, len);
QETH_DBF_HEX(CTRL, 2, iob->data, min(len, QETH_DBF_CTRL_LEN));
QETH_CARD_TEXT(card, 6, "osnoirqp");
spin_lock_irq(get_ccwdev_lock(channel->ccwdev));
rc = ccw_device_start_timeout(channel->ccwdev, channel->ccw,
(addr_t) iob, 0, 0, iob->timeout);
spin_unlock_irq(get_ccwdev_lock(channel->ccwdev));
if (rc) {
QETH_DBF_MESSAGE(2, "qeth_osn_send_control_data: "
"ccw_device_start rc = %i\n", rc);
QETH_CARD_TEXT_(card, 2, " err%d", rc);
qeth_release_buffer(channel, iob);
atomic_set(&channel->irq_pending, 0);
wake_up(&card->wait_q);
}
return rc;
}
static int qeth_osn_send_ipa_cmd(struct qeth_card *card,
struct qeth_cmd_buffer *iob)
{
u16 length;
QETH_CARD_TEXT(card, 4, "osndipa");
memcpy(&length, QETH_IPA_PDU_LEN_TOTAL(iob->data), 2);
return qeth_osn_send_control_data(card, length, iob);
} }
int qeth_osn_assist(struct net_device *dev, void *data, int data_len) int qeth_osn_assist(struct net_device *dev, void *data, int data_len)
...@@ -1087,10 +1048,14 @@ int qeth_osn_assist(struct net_device *dev, void *data, int data_len) ...@@ -1087,10 +1048,14 @@ int qeth_osn_assist(struct net_device *dev, void *data, int data_len)
QETH_CARD_TEXT(card, 2, "osnsdmc"); QETH_CARD_TEXT(card, 2, "osnsdmc");
if (!qeth_card_hw_is_reachable(card)) if (!qeth_card_hw_is_reachable(card))
return -ENODEV; return -ENODEV;
iob = qeth_wait_for_buffer(&card->write); iob = qeth_get_buffer(&card->write);
if (!iob)
return -ENOMEM;
qeth_prepare_ipa_cmd(card, iob, (u16) data_len); qeth_prepare_ipa_cmd(card, iob, (u16) data_len);
memcpy(__ipa_cmd(iob), data, data_len); memcpy(__ipa_cmd(iob), data, data_len);
return qeth_osn_send_ipa_cmd(card, iob); iob->callback = qeth_osn_assist_cb;
return qeth_send_ipa_cmd(card, iob, NULL, NULL);
} }
EXPORT_SYMBOL(qeth_osn_assist); EXPORT_SYMBOL(qeth_osn_assist);
...@@ -1845,7 +1810,7 @@ static int qeth_l2_vnicc_request(struct qeth_card *card, ...@@ -1845,7 +1810,7 @@ static int qeth_l2_vnicc_request(struct qeth_card *card,
req->getset_timeout.vnic_char = cbctl->param.vnic_char; req->getset_timeout.vnic_char = cbctl->param.vnic_char;
break; break;
default: default:
qeth_release_buffer(iob->channel, iob); qeth_release_buffer(iob);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
...@@ -742,7 +742,7 @@ static int qeth_l3_setadapter_parms(struct qeth_card *card) ...@@ -742,7 +742,7 @@ static int qeth_l3_setadapter_parms(struct qeth_card *card)
{ {
int rc = 0; int rc = 0;
QETH_DBF_TEXT(SETUP, 2, "setadprm"); QETH_CARD_TEXT(card, 2, "setadprm");
if (qeth_adp_supported(card, IPA_SETADP_ALTER_MAC_ADDRESS)) { if (qeth_adp_supported(card, IPA_SETADP_ALTER_MAC_ADDRESS)) {
rc = qeth_setadpparms_change_macaddr(card); rc = qeth_setadpparms_change_macaddr(card);
...@@ -979,7 +979,7 @@ static int qeth_l3_iqd_read_initial_mac(struct qeth_card *card) ...@@ -979,7 +979,7 @@ static int qeth_l3_iqd_read_initial_mac(struct qeth_card *card)
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd; struct qeth_ipa_cmd *cmd;
QETH_DBF_TEXT(SETUP, 2, "hsrmac"); QETH_CARD_TEXT(card, 2, "hsrmac");
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_CREATE_ADDR, iob = qeth_get_ipacmd_buffer(card, IPA_CMD_CREATE_ADDR,
QETH_PROT_IPV6); QETH_PROT_IPV6);
...@@ -1017,7 +1017,7 @@ static int qeth_l3_get_unique_id(struct qeth_card *card) ...@@ -1017,7 +1017,7 @@ static int qeth_l3_get_unique_id(struct qeth_card *card)
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd; struct qeth_ipa_cmd *cmd;
QETH_DBF_TEXT(SETUP, 2, "guniqeid"); QETH_CARD_TEXT(card, 2, "guniqeid");
if (!qeth_is_supported(card, IPA_IPV6)) { if (!qeth_is_supported(card, IPA_IPV6)) {
card->info.unique_id = UNIQUE_ID_IF_CREATE_ADDR_FAILED | card->info.unique_id = UNIQUE_ID_IF_CREATE_ADDR_FAILED |
...@@ -1044,7 +1044,7 @@ qeth_diags_trace_cb(struct qeth_card *card, struct qeth_reply *reply, ...@@ -1044,7 +1044,7 @@ qeth_diags_trace_cb(struct qeth_card *card, struct qeth_reply *reply,
struct qeth_ipa_cmd *cmd; struct qeth_ipa_cmd *cmd;
__u16 rc; __u16 rc;
QETH_DBF_TEXT(SETUP, 2, "diastrcb"); QETH_CARD_TEXT(card, 2, "diastrcb");
cmd = (struct qeth_ipa_cmd *)data; cmd = (struct qeth_ipa_cmd *)data;
rc = cmd->hdr.return_code; rc = cmd->hdr.return_code;
...@@ -1100,7 +1100,7 @@ qeth_diags_trace(struct qeth_card *card, enum qeth_diags_trace_cmds diags_cmd) ...@@ -1100,7 +1100,7 @@ qeth_diags_trace(struct qeth_card *card, enum qeth_diags_trace_cmds diags_cmd)
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd; struct qeth_ipa_cmd *cmd;
QETH_DBF_TEXT(SETUP, 2, "diagtrac"); QETH_CARD_TEXT(card, 2, "diagtrac");
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0); iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0);
if (!iob) if (!iob)
...@@ -1413,8 +1413,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card, ...@@ -1413,8 +1413,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
static void qeth_l3_stop_card(struct qeth_card *card) static void qeth_l3_stop_card(struct qeth_card *card)
{ {
QETH_DBF_TEXT(SETUP, 2, "stopcard"); QETH_CARD_TEXT(card, 2, "stopcard");
QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *));
qeth_set_allowed_threads(card, 0, 1); qeth_set_allowed_threads(card, 0, 1);
...@@ -1436,11 +1435,8 @@ static void qeth_l3_stop_card(struct qeth_card *card) ...@@ -1436,11 +1435,8 @@ static void qeth_l3_stop_card(struct qeth_card *card)
qeth_clear_working_pool_list(card); qeth_clear_working_pool_list(card);
card->state = CARD_STATE_DOWN; card->state = CARD_STATE_DOWN;
} }
if (card->state == CARD_STATE_DOWN) {
qeth_clear_cmd_buffers(&card->read);
qeth_clear_cmd_buffers(&card->write);
}
qeth_clear_cmd_buffers(&card->write);
flush_workqueue(card->event_wq); flush_workqueue(card->event_wq);
} }
...@@ -2337,12 +2333,11 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev) ...@@ -2337,12 +2333,11 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev)
mutex_lock(&card->discipline_mutex); mutex_lock(&card->discipline_mutex);
mutex_lock(&card->conf_mutex); mutex_lock(&card->conf_mutex);
QETH_DBF_TEXT(SETUP, 2, "setonlin"); QETH_CARD_TEXT(card, 2, "setonlin");
QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *));
rc = qeth_core_hardsetup_card(card, &carrier_ok); rc = qeth_core_hardsetup_card(card, &carrier_ok);
if (rc) { if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "2err%04x", rc); QETH_CARD_TEXT_(card, 2, "2err%04x", rc);
rc = -ENODEV; rc = -ENODEV;
goto out_remove; goto out_remove;
} }
...@@ -2358,28 +2353,28 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev) ...@@ -2358,28 +2353,28 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev)
qeth_print_status_message(card); qeth_print_status_message(card);
/* softsetup */ /* softsetup */
QETH_DBF_TEXT(SETUP, 2, "softsetp"); QETH_CARD_TEXT(card, 2, "softsetp");
rc = qeth_l3_setadapter_parms(card); rc = qeth_l3_setadapter_parms(card);
if (rc) if (rc)
QETH_DBF_TEXT_(SETUP, 2, "2err%04x", rc); QETH_CARD_TEXT_(card, 2, "2err%04x", rc);
if (!card->options.sniffer) { if (!card->options.sniffer) {
rc = qeth_l3_start_ipassists(card); rc = qeth_l3_start_ipassists(card);
if (rc) { if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc); QETH_CARD_TEXT_(card, 2, "3err%d", rc);
goto out_remove; goto out_remove;
} }
rc = qeth_l3_setrouting_v4(card); rc = qeth_l3_setrouting_v4(card);
if (rc) if (rc)
QETH_DBF_TEXT_(SETUP, 2, "4err%04x", rc); QETH_CARD_TEXT_(card, 2, "4err%04x", rc);
rc = qeth_l3_setrouting_v6(card); rc = qeth_l3_setrouting_v6(card);
if (rc) if (rc)
QETH_DBF_TEXT_(SETUP, 2, "5err%04x", rc); QETH_CARD_TEXT_(card, 2, "5err%04x", rc);
} }
rc = qeth_init_qdio_queues(card); rc = qeth_init_qdio_queues(card);
if (rc) { if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc); QETH_CARD_TEXT_(card, 2, "6err%d", rc);
rc = -ENODEV; rc = -ENODEV;
goto out_remove; goto out_remove;
} }
...@@ -2420,7 +2415,6 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev) ...@@ -2420,7 +2415,6 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev)
ccw_device_set_offline(CARD_WDEV(card)); ccw_device_set_offline(CARD_WDEV(card));
ccw_device_set_offline(CARD_RDEV(card)); ccw_device_set_offline(CARD_RDEV(card));
qdio_free(CARD_DDEV(card)); qdio_free(CARD_DDEV(card));
card->state = CARD_STATE_DOWN;
mutex_unlock(&card->conf_mutex); mutex_unlock(&card->conf_mutex);
mutex_unlock(&card->discipline_mutex); mutex_unlock(&card->discipline_mutex);
...@@ -2435,8 +2429,7 @@ static int __qeth_l3_set_offline(struct ccwgroup_device *cgdev, ...@@ -2435,8 +2429,7 @@ static int __qeth_l3_set_offline(struct ccwgroup_device *cgdev,
mutex_lock(&card->discipline_mutex); mutex_lock(&card->discipline_mutex);
mutex_lock(&card->conf_mutex); mutex_lock(&card->conf_mutex);
QETH_DBF_TEXT(SETUP, 3, "setoffl"); QETH_CARD_TEXT(card, 3, "setoffl");
QETH_DBF_HEX(SETUP, 3, &card, sizeof(void *));
if ((!recovery_mode && card->info.hwtrap) || card->info.hwtrap == 2) { if ((!recovery_mode && card->info.hwtrap) || card->info.hwtrap == 2) {
qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
...@@ -2462,7 +2455,7 @@ static int __qeth_l3_set_offline(struct ccwgroup_device *cgdev, ...@@ -2462,7 +2455,7 @@ static int __qeth_l3_set_offline(struct ccwgroup_device *cgdev,
if (!rc) if (!rc)
rc = (rc2) ? rc2 : rc3; rc = (rc2) ? rc2 : rc3;
if (rc) if (rc)
QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); QETH_CARD_TEXT_(card, 2, "1err%d", rc);
qdio_free(CARD_DDEV(card)); qdio_free(CARD_DDEV(card));
/* let user_space know that device is offline */ /* let user_space know that device is offline */
......
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