struct qdio_ssqd_desc ssqd;
debug_info_t *debug;
struct mutex conf_mutex;
+ struct mutex discipline_mutex;
};
struct qeth_card_list_struct {
spin_lock_init(&card->ip_lock);
spin_lock_init(&card->thread_mask_lock);
mutex_init(&card->conf_mutex);
+ mutex_init(&card->discipline_mutex);
card->thread_start_mask = 0;
card->thread_allowed_mask = 0;
card->thread_running_mask = 0;
struct qeth_card *card = dev_get_drvdata(&gdev->dev);
QETH_DBF_TEXT(SETUP, 2, "removedv");
- if (card->discipline.ccwgdriver) {
- card->discipline.ccwgdriver->remove(gdev);
- qeth_core_free_discipline(card);
- }
if (card->info.type == QETH_CARD_TYPE_OSN) {
qeth_core_remove_osn_attributes(&gdev->dev);
} else {
qeth_core_remove_device_attributes(&gdev->dev);
}
+
+ if (card->discipline.ccwgdriver) {
+ card->discipline.ccwgdriver->remove(gdev);
+ qeth_core_free_discipline(card);
+ }
+
debug_unregister(card->debug);
write_lock_irqsave(&qeth_core_card_list.rwlock, flags);
list_del(&card->list);
if (!card)
return -EINVAL;
- mutex_lock(&card->conf_mutex);
+ mutex_lock(&card->discipline_mutex);
if (card->state != CARD_STATE_DOWN) {
rc = -EPERM;
goto out;
rc = card->discipline.ccwgdriver->probe(card->gdev);
out:
- mutex_unlock(&card->conf_mutex);
+ mutex_unlock(&card->discipline_mutex);
return rc ? rc : count;
}
enum qeth_card_states recover_flag;
BUG_ON(!card);
+ mutex_lock(&card->discipline_mutex);
mutex_lock(&card->conf_mutex);
QETH_DBF_TEXT(SETUP, 2, "setonlin");
QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *));
kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE);
out:
mutex_unlock(&card->conf_mutex);
+ mutex_unlock(&card->discipline_mutex);
return 0;
out_remove:
else
card->state = CARD_STATE_DOWN;
mutex_unlock(&card->conf_mutex);
+ mutex_unlock(&card->discipline_mutex);
return rc;
}
int rc = 0, rc2 = 0, rc3 = 0;
enum qeth_card_states recover_flag;
+ mutex_lock(&card->discipline_mutex);
mutex_lock(&card->conf_mutex);
QETH_DBF_TEXT(SETUP, 3, "setoffl");
QETH_DBF_HEX(SETUP, 3, &card, sizeof(void *));
/* let user_space know that device is offline */
kobject_uevent(&cgdev->dev.kobj, KOBJ_CHANGE);
mutex_unlock(&card->conf_mutex);
+ mutex_unlock(&card->discipline_mutex);
return 0;
}
{
struct qeth_card *card = dev_get_drvdata(&cgdev->dev);
+ qeth_l3_remove_device_attributes(&cgdev->dev);
+
qeth_set_allowed_threads(card, 0, 1);
wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
card->dev = NULL;
}
- qeth_l3_remove_device_attributes(&cgdev->dev);
qeth_l3_clear_ip_list(card, 0, 0);
qeth_l3_clear_ipato_list(card);
return;
enum qeth_card_states recover_flag;
BUG_ON(!card);
+ mutex_lock(&card->discipline_mutex);
mutex_lock(&card->conf_mutex);
QETH_DBF_TEXT(SETUP, 2, "setonlin");
QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *));
kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE);
out:
mutex_unlock(&card->conf_mutex);
+ mutex_unlock(&card->discipline_mutex);
return 0;
out_remove:
card->use_hard_stop = 1;
else
card->state = CARD_STATE_DOWN;
mutex_unlock(&card->conf_mutex);
+ mutex_unlock(&card->discipline_mutex);
return rc;
}
int rc = 0, rc2 = 0, rc3 = 0;
enum qeth_card_states recover_flag;
+ mutex_lock(&card->discipline_mutex);
mutex_lock(&card->conf_mutex);
QETH_DBF_TEXT(SETUP, 3, "setoffl");
QETH_DBF_HEX(SETUP, 3, &card, sizeof(void *));
/* let user_space know that device is offline */
kobject_uevent(&cgdev->dev.kobj, KOBJ_CHANGE);
mutex_unlock(&card->conf_mutex);
+ mutex_unlock(&card->discipline_mutex);
return 0;
}