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

s390/qeth: remove duplicated device matching

With commit "s390/ccwgroup: tie a ccwgroup driver to its ccw driver",
the ccwgroup core now ensures that a qeth group device only consists of
ccw devices which are supported by qeth. Therefore remove qeth's
internal device matching, and use .driver_info to determine the card
type.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dbb27af9
...@@ -231,20 +231,6 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa, ...@@ -231,20 +231,6 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,
#define QETH_IDX_FUNC_LEVEL_OSD 0x0101 #define QETH_IDX_FUNC_LEVEL_OSD 0x0101
#define QETH_IDX_FUNC_LEVEL_IQD 0x4108 #define QETH_IDX_FUNC_LEVEL_IQD 0x4108
#define QETH_MODELLIST_ARRAY \
{{0x1731, 0x01, 0x1732, QETH_CARD_TYPE_OSD, QETH_MAX_QUEUES, 0}, \
{0x1731, 0x05, 0x1732, QETH_CARD_TYPE_IQD, QETH_MAX_QUEUES, 0x103}, \
{0x1731, 0x06, 0x1732, QETH_CARD_TYPE_OSN, QETH_MAX_QUEUES, 0}, \
{0x1731, 0x02, 0x1732, QETH_CARD_TYPE_OSM, QETH_MAX_QUEUES, 0}, \
{0x1731, 0x02, 0x1732, QETH_CARD_TYPE_OSX, QETH_MAX_QUEUES, 0}, \
{0, 0, 0, 0, 0, 0} }
#define QETH_CU_TYPE_IND 0
#define QETH_CU_MODEL_IND 1
#define QETH_DEV_TYPE_IND 2
#define QETH_DEV_MODEL_IND 3
#define QETH_QUEUE_NO_IND 4
#define QETH_MULTICAST_IND 5
#define QETH_REAL_CARD 1 #define QETH_REAL_CARD 1
#define QETH_VLAN_CARD 2 #define QETH_VLAN_CARD 2
#define QETH_BUFSIZE 4096 #define QETH_BUFSIZE 4096
......
...@@ -52,7 +52,6 @@ EXPORT_SYMBOL_GPL(qeth_core_header_cache); ...@@ -52,7 +52,6 @@ EXPORT_SYMBOL_GPL(qeth_core_header_cache);
static struct kmem_cache *qeth_qdio_outbuf_cache; static struct kmem_cache *qeth_qdio_outbuf_cache;
static struct device *qeth_core_root_dev; static struct device *qeth_core_root_dev;
static unsigned int known_devices[][6] = QETH_MODELLIST_ARRAY;
static struct lock_class_key qdio_out_skb_queue_key; static struct lock_class_key qdio_out_skb_queue_key;
static struct mutex qeth_mod_mutex; static struct mutex qeth_mod_mutex;
...@@ -1386,6 +1385,7 @@ static void qeth_init_qdio_info(struct qeth_card *card) ...@@ -1386,6 +1385,7 @@ static void qeth_init_qdio_info(struct qeth_card *card)
QETH_DBF_TEXT(SETUP, 4, "intqdinf"); QETH_DBF_TEXT(SETUP, 4, "intqdinf");
atomic_set(&card->qdio.state, QETH_QDIO_UNINITIALIZED); atomic_set(&card->qdio.state, QETH_QDIO_UNINITIALIZED);
/* inbound */ /* inbound */
card->qdio.no_in_queues = 1;
card->qdio.in_buf_size = QETH_IN_BUF_SIZE_DEFAULT; card->qdio.in_buf_size = QETH_IN_BUF_SIZE_DEFAULT;
if (card->info.type == QETH_CARD_TYPE_IQD) if (card->info.type == QETH_CARD_TYPE_IQD)
card->qdio.init_pool.buf_count = QETH_IN_BUF_COUNT_HSDEFAULT; card->qdio.init_pool.buf_count = QETH_IN_BUF_COUNT_HSDEFAULT;
...@@ -1519,34 +1519,17 @@ static struct qeth_card *qeth_alloc_card(void) ...@@ -1519,34 +1519,17 @@ static struct qeth_card *qeth_alloc_card(void)
return NULL; return NULL;
} }
static int qeth_determine_card_type(struct qeth_card *card) static void qeth_determine_card_type(struct qeth_card *card)
{ {
int i = 0;
QETH_DBF_TEXT(SETUP, 2, "detcdtyp"); QETH_DBF_TEXT(SETUP, 2, "detcdtyp");
card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT; card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT;
card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; card->qdio.default_out_queue = QETH_DEFAULT_QUEUE;
while (known_devices[i][QETH_DEV_MODEL_IND]) { card->info.type = CARD_RDEV(card)->id.driver_info;
if ((CARD_RDEV(card)->id.dev_type == card->qdio.no_out_queues = QETH_MAX_QUEUES;
known_devices[i][QETH_DEV_TYPE_IND]) && if (card->info.type == QETH_CARD_TYPE_IQD)
(CARD_RDEV(card)->id.dev_model == card->info.is_multicast_different = 0x0103;
known_devices[i][QETH_DEV_MODEL_IND])) { qeth_update_from_chp_desc(card);
card->info.type = known_devices[i][QETH_DEV_MODEL_IND];
card->qdio.no_out_queues =
known_devices[i][QETH_QUEUE_NO_IND];
card->qdio.no_in_queues = 1;
card->info.is_multicast_different =
known_devices[i][QETH_MULTICAST_IND];
qeth_update_from_chp_desc(card);
return 0;
}
i++;
}
card->info.type = QETH_CARD_TYPE_UNKNOWN;
dev_err(&card->gdev->dev, "The adapter hardware is of an "
"unknown type\n");
return -ENOENT;
} }
static int qeth_clear_channel(struct qeth_channel *channel) static int qeth_clear_channel(struct qeth_channel *channel)
...@@ -2233,8 +2216,6 @@ static int qeth_cm_setup(struct qeth_card *card) ...@@ -2233,8 +2216,6 @@ static int qeth_cm_setup(struct qeth_card *card)
static int qeth_get_initial_mtu_for_card(struct qeth_card *card) static int qeth_get_initial_mtu_for_card(struct qeth_card *card)
{ {
switch (card->info.type) { switch (card->info.type) {
case QETH_CARD_TYPE_UNKNOWN:
return 1500;
case QETH_CARD_TYPE_IQD: case QETH_CARD_TYPE_IQD:
return card->info.max_mtu; return card->info.max_mtu;
case QETH_CARD_TYPE_OSD: case QETH_CARD_TYPE_OSD:
...@@ -2279,7 +2260,6 @@ static int qeth_mtu_is_valid(struct qeth_card *card, int mtu) ...@@ -2279,7 +2260,6 @@ static int qeth_mtu_is_valid(struct qeth_card *card, int mtu)
return ((mtu >= 576) && return ((mtu >= 576) &&
(mtu <= card->info.max_mtu)); (mtu <= card->info.max_mtu));
case QETH_CARD_TYPE_OSN: case QETH_CARD_TYPE_OSN:
case QETH_CARD_TYPE_UNKNOWN:
default: default:
return 1; return 1;
} }
...@@ -5724,11 +5704,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev) ...@@ -5724,11 +5704,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
gdev->cdev[1]->handler = qeth_irq; gdev->cdev[1]->handler = qeth_irq;
gdev->cdev[2]->handler = qeth_irq; gdev->cdev[2]->handler = qeth_irq;
rc = qeth_determine_card_type(card); qeth_determine_card_type(card);
if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc);
goto err_card;
}
rc = qeth_setup_card(card); rc = qeth_setup_card(card);
if (rc) { if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
......
...@@ -44,7 +44,6 @@ extern unsigned char IPA_PDU_HEADER[]; ...@@ -44,7 +44,6 @@ extern unsigned char IPA_PDU_HEADER[];
#define IPA_CMD_PRIM_VERSION_NO 0x01 #define IPA_CMD_PRIM_VERSION_NO 0x01
enum qeth_card_types { enum qeth_card_types {
QETH_CARD_TYPE_UNKNOWN = 0,
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_OSN = 6,
......
...@@ -475,10 +475,8 @@ static ssize_t qeth_dev_isolation_store(struct device *dev, ...@@ -475,10 +475,8 @@ static ssize_t qeth_dev_isolation_store(struct device *dev,
return -EINVAL; return -EINVAL;
mutex_lock(&card->conf_mutex); mutex_lock(&card->conf_mutex);
/* check for unknown, too, in case we do not yet know who we are */
if (card->info.type != QETH_CARD_TYPE_OSD && if (card->info.type != QETH_CARD_TYPE_OSD &&
card->info.type != QETH_CARD_TYPE_OSX && card->info.type != QETH_CARD_TYPE_OSX) {
card->info.type != QETH_CARD_TYPE_UNKNOWN) {
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
dev_err(&card->gdev->dev, "Adapter does not " dev_err(&card->gdev->dev, "Adapter does not "
"support QDIO data connection isolation\n"); "support QDIO data connection isolation\n");
......
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