diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-21 15:41:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-21 15:41:17 -0400 |
commit | e60b9a0346ee08af4715ee5b2d82f705fbe6e309 (patch) | |
tree | 886e1be2a283806e1dc940b7379a5a6e4683a97b /drivers/s390/net | |
parent | 9daeaa370526df1c19eba4780247bb7155541e38 (diff) | |
parent | a7475afd530e6bf81c9025b0134dd1c7c6f1a219 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Martin Schwidefsky:
"Just a random collection of bug-fixes and cleanups, nothing new in
this merge request."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (46 commits)
s390/ap: Fix wrong or missing comments
s390/ap: move receive callback to message struct
s390/dasd: re-prioritize partition detection message
s390/qeth: reshuffle initialization
s390/qeth: cleanup drv attr usage
s390/claw: cleanup drv attr usage
s390/lcs: cleanup drv attr usage
s390/ctc: cleanup drv attr usage
s390/ccwgroup: remove ccwgroup_create_from_string
s390/qeth: stop using struct ccwgroup driver for discipline callbacks
s390/qeth: switch to ccwgroup_create_dev
s390/claw: switch to ccwgroup_create_dev
s390/lcs: switch to ccwgroup_create_dev
s390/ctcm: switch to ccwgroup_create_dev
s390/ccwgroup: exploit ccwdev_by_dev_id
s390/ccwgroup: introduce ccwgroup_create_dev
s390: fix race on TIF_MCCK_PENDING
s390/barrier: make use of fast-bcr facility
s390/barrier: cleanup barrier functions
s390/claw: remove "eieio" calls
...
Diffstat (limited to 'drivers/s390/net')
-rw-r--r-- | drivers/s390/net/claw.c | 165 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_main.c | 52 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_main.h | 8 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_sysfs.c | 37 | ||||
-rw-r--r-- | drivers/s390/net/lcs.c | 52 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core.h | 24 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 178 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core_sys.c | 49 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 16 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 16 |
10 files changed, 235 insertions, 362 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index b41fae37d3af..6b1ff90d2f00 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c | |||
@@ -136,7 +136,6 @@ static inline void | |||
136 | claw_set_busy(struct net_device *dev) | 136 | claw_set_busy(struct net_device *dev) |
137 | { | 137 | { |
138 | ((struct claw_privbk *)dev->ml_priv)->tbusy = 1; | 138 | ((struct claw_privbk *)dev->ml_priv)->tbusy = 1; |
139 | eieio(); | ||
140 | } | 139 | } |
141 | 140 | ||
142 | static inline void | 141 | static inline void |
@@ -144,13 +143,11 @@ claw_clear_busy(struct net_device *dev) | |||
144 | { | 143 | { |
145 | clear_bit(0, &(((struct claw_privbk *) dev->ml_priv)->tbusy)); | 144 | clear_bit(0, &(((struct claw_privbk *) dev->ml_priv)->tbusy)); |
146 | netif_wake_queue(dev); | 145 | netif_wake_queue(dev); |
147 | eieio(); | ||
148 | } | 146 | } |
149 | 147 | ||
150 | static inline int | 148 | static inline int |
151 | claw_check_busy(struct net_device *dev) | 149 | claw_check_busy(struct net_device *dev) |
152 | { | 150 | { |
153 | eieio(); | ||
154 | return ((struct claw_privbk *) dev->ml_priv)->tbusy; | 151 | return ((struct claw_privbk *) dev->ml_priv)->tbusy; |
155 | } | 152 | } |
156 | 153 | ||
@@ -233,8 +230,6 @@ static ssize_t claw_rbuff_show(struct device *dev, | |||
233 | static ssize_t claw_rbuff_write(struct device *dev, | 230 | static ssize_t claw_rbuff_write(struct device *dev, |
234 | struct device_attribute *attr, | 231 | struct device_attribute *attr, |
235 | const char *buf, size_t count); | 232 | const char *buf, size_t count); |
236 | static int claw_add_files(struct device *dev); | ||
237 | static void claw_remove_files(struct device *dev); | ||
238 | 233 | ||
239 | /* Functions for System Validate */ | 234 | /* Functions for System Validate */ |
240 | static int claw_process_control( struct net_device *dev, struct ccwbk * p_ccw); | 235 | static int claw_process_control( struct net_device *dev, struct ccwbk * p_ccw); |
@@ -267,12 +262,10 @@ static struct ccwgroup_driver claw_group_driver = { | |||
267 | .owner = THIS_MODULE, | 262 | .owner = THIS_MODULE, |
268 | .name = "claw", | 263 | .name = "claw", |
269 | }, | 264 | }, |
270 | .max_slaves = 2, | 265 | .setup = claw_probe, |
271 | .driver_id = 0xC3D3C1E6, | 266 | .remove = claw_remove_device, |
272 | .probe = claw_probe, | 267 | .set_online = claw_new_device, |
273 | .remove = claw_remove_device, | 268 | .set_offline = claw_shutdown_device, |
274 | .set_online = claw_new_device, | ||
275 | .set_offline = claw_shutdown_device, | ||
276 | .prepare = claw_pm_prepare, | 269 | .prepare = claw_pm_prepare, |
277 | }; | 270 | }; |
278 | 271 | ||
@@ -293,30 +286,24 @@ static struct ccw_driver claw_ccw_driver = { | |||
293 | .int_class = IOINT_CLW, | 286 | .int_class = IOINT_CLW, |
294 | }; | 287 | }; |
295 | 288 | ||
296 | static ssize_t | 289 | static ssize_t claw_driver_group_store(struct device_driver *ddrv, |
297 | claw_driver_group_store(struct device_driver *ddrv, const char *buf, | 290 | const char *buf, size_t count) |
298 | size_t count) | ||
299 | { | 291 | { |
300 | int err; | 292 | int err; |
301 | err = ccwgroup_create_from_string(claw_root_dev, | 293 | err = ccwgroup_create_dev(claw_root_dev, &claw_group_driver, 2, buf); |
302 | claw_group_driver.driver_id, | ||
303 | &claw_ccw_driver, 2, buf); | ||
304 | return err ? err : count; | 294 | return err ? err : count; |
305 | } | 295 | } |
306 | |||
307 | static DRIVER_ATTR(group, 0200, NULL, claw_driver_group_store); | 296 | static DRIVER_ATTR(group, 0200, NULL, claw_driver_group_store); |
308 | 297 | ||
309 | static struct attribute *claw_group_attrs[] = { | 298 | static struct attribute *claw_drv_attrs[] = { |
310 | &driver_attr_group.attr, | 299 | &driver_attr_group.attr, |
311 | NULL, | 300 | NULL, |
312 | }; | 301 | }; |
313 | 302 | static struct attribute_group claw_drv_attr_group = { | |
314 | static struct attribute_group claw_group_attr_group = { | 303 | .attrs = claw_drv_attrs, |
315 | .attrs = claw_group_attrs, | ||
316 | }; | 304 | }; |
317 | 305 | static const struct attribute_group *claw_drv_attr_groups[] = { | |
318 | static const struct attribute_group *claw_group_attr_groups[] = { | 306 | &claw_drv_attr_group, |
319 | &claw_group_attr_group, | ||
320 | NULL, | 307 | NULL, |
321 | }; | 308 | }; |
322 | 309 | ||
@@ -324,60 +311,6 @@ static const struct attribute_group *claw_group_attr_groups[] = { | |||
324 | * Key functions | 311 | * Key functions |
325 | */ | 312 | */ |
326 | 313 | ||
327 | /*----------------------------------------------------------------* | ||
328 | * claw_probe * | ||
329 | * this function is called for each CLAW device. * | ||
330 | *----------------------------------------------------------------*/ | ||
331 | static int | ||
332 | claw_probe(struct ccwgroup_device *cgdev) | ||
333 | { | ||
334 | int rc; | ||
335 | struct claw_privbk *privptr=NULL; | ||
336 | |||
337 | CLAW_DBF_TEXT(2, setup, "probe"); | ||
338 | if (!get_device(&cgdev->dev)) | ||
339 | return -ENODEV; | ||
340 | privptr = kzalloc(sizeof(struct claw_privbk), GFP_KERNEL); | ||
341 | dev_set_drvdata(&cgdev->dev, privptr); | ||
342 | if (privptr == NULL) { | ||
343 | probe_error(cgdev); | ||
344 | put_device(&cgdev->dev); | ||
345 | CLAW_DBF_TEXT_(2, setup, "probex%d", -ENOMEM); | ||
346 | return -ENOMEM; | ||
347 | } | ||
348 | privptr->p_mtc_envelope= kzalloc( MAX_ENVELOPE_SIZE, GFP_KERNEL); | ||
349 | privptr->p_env = kzalloc(sizeof(struct claw_env), GFP_KERNEL); | ||
350 | if ((privptr->p_mtc_envelope==NULL) || (privptr->p_env==NULL)) { | ||
351 | probe_error(cgdev); | ||
352 | put_device(&cgdev->dev); | ||
353 | CLAW_DBF_TEXT_(2, setup, "probex%d", -ENOMEM); | ||
354 | return -ENOMEM; | ||
355 | } | ||
356 | memcpy(privptr->p_env->adapter_name,WS_NAME_NOT_DEF,8); | ||
357 | memcpy(privptr->p_env->host_name,WS_NAME_NOT_DEF,8); | ||
358 | memcpy(privptr->p_env->api_type,WS_NAME_NOT_DEF,8); | ||
359 | privptr->p_env->packing = 0; | ||
360 | privptr->p_env->write_buffers = 5; | ||
361 | privptr->p_env->read_buffers = 5; | ||
362 | privptr->p_env->read_size = CLAW_FRAME_SIZE; | ||
363 | privptr->p_env->write_size = CLAW_FRAME_SIZE; | ||
364 | rc = claw_add_files(&cgdev->dev); | ||
365 | if (rc) { | ||
366 | probe_error(cgdev); | ||
367 | put_device(&cgdev->dev); | ||
368 | dev_err(&cgdev->dev, "Creating the /proc files for a new" | ||
369 | " CLAW device failed\n"); | ||
370 | CLAW_DBF_TEXT_(2, setup, "probex%d", rc); | ||
371 | return rc; | ||
372 | } | ||
373 | privptr->p_env->p_priv = privptr; | ||
374 | cgdev->cdev[0]->handler = claw_irq_handler; | ||
375 | cgdev->cdev[1]->handler = claw_irq_handler; | ||
376 | CLAW_DBF_TEXT(2, setup, "prbext 0"); | ||
377 | |||
378 | return 0; | ||
379 | } /* end of claw_probe */ | ||
380 | |||
381 | /*-------------------------------------------------------------------* | 314 | /*-------------------------------------------------------------------* |
382 | * claw_tx * | 315 | * claw_tx * |
383 | *-------------------------------------------------------------------*/ | 316 | *-------------------------------------------------------------------*/ |
@@ -3093,7 +3026,6 @@ claw_remove_device(struct ccwgroup_device *cgdev) | |||
3093 | dev_info(&cgdev->dev, " will be removed.\n"); | 3026 | dev_info(&cgdev->dev, " will be removed.\n"); |
3094 | if (cgdev->state == CCWGROUP_ONLINE) | 3027 | if (cgdev->state == CCWGROUP_ONLINE) |
3095 | claw_shutdown_device(cgdev); | 3028 | claw_shutdown_device(cgdev); |
3096 | claw_remove_files(&cgdev->dev); | ||
3097 | kfree(priv->p_mtc_envelope); | 3029 | kfree(priv->p_mtc_envelope); |
3098 | priv->p_mtc_envelope=NULL; | 3030 | priv->p_mtc_envelope=NULL; |
3099 | kfree(priv->p_env); | 3031 | kfree(priv->p_env); |
@@ -3321,7 +3253,6 @@ claw_rbuff_write(struct device *dev, struct device_attribute *attr, | |||
3321 | CLAW_DBF_TEXT_(2, setup, "RB=%d", p_env->read_buffers); | 3253 | CLAW_DBF_TEXT_(2, setup, "RB=%d", p_env->read_buffers); |
3322 | return count; | 3254 | return count; |
3323 | } | 3255 | } |
3324 | |||
3325 | static DEVICE_ATTR(read_buffer, 0644, claw_rbuff_show, claw_rbuff_write); | 3256 | static DEVICE_ATTR(read_buffer, 0644, claw_rbuff_show, claw_rbuff_write); |
3326 | 3257 | ||
3327 | static struct attribute *claw_attr[] = { | 3258 | static struct attribute *claw_attr[] = { |
@@ -3332,40 +3263,73 @@ static struct attribute *claw_attr[] = { | |||
3332 | &dev_attr_host_name.attr, | 3263 | &dev_attr_host_name.attr, |
3333 | NULL, | 3264 | NULL, |
3334 | }; | 3265 | }; |
3335 | |||
3336 | static struct attribute_group claw_attr_group = { | 3266 | static struct attribute_group claw_attr_group = { |
3337 | .attrs = claw_attr, | 3267 | .attrs = claw_attr, |
3338 | }; | 3268 | }; |
3269 | static const struct attribute_group *claw_attr_groups[] = { | ||
3270 | &claw_attr_group, | ||
3271 | NULL, | ||
3272 | }; | ||
3273 | static const struct device_type claw_devtype = { | ||
3274 | .name = "claw", | ||
3275 | .groups = claw_attr_groups, | ||
3276 | }; | ||
3339 | 3277 | ||
3340 | static int | 3278 | /*----------------------------------------------------------------* |
3341 | claw_add_files(struct device *dev) | 3279 | * claw_probe * |
3280 | * this function is called for each CLAW device. * | ||
3281 | *----------------------------------------------------------------*/ | ||
3282 | static int claw_probe(struct ccwgroup_device *cgdev) | ||
3342 | { | 3283 | { |
3343 | CLAW_DBF_TEXT(2, setup, "add_file"); | 3284 | struct claw_privbk *privptr = NULL; |
3344 | return sysfs_create_group(&dev->kobj, &claw_attr_group); | ||
3345 | } | ||
3346 | 3285 | ||
3347 | static void | 3286 | CLAW_DBF_TEXT(2, setup, "probe"); |
3348 | claw_remove_files(struct device *dev) | 3287 | if (!get_device(&cgdev->dev)) |
3349 | { | 3288 | return -ENODEV; |
3350 | CLAW_DBF_TEXT(2, setup, "rem_file"); | 3289 | privptr = kzalloc(sizeof(struct claw_privbk), GFP_KERNEL); |
3351 | sysfs_remove_group(&dev->kobj, &claw_attr_group); | 3290 | dev_set_drvdata(&cgdev->dev, privptr); |
3352 | } | 3291 | if (privptr == NULL) { |
3292 | probe_error(cgdev); | ||
3293 | put_device(&cgdev->dev); | ||
3294 | CLAW_DBF_TEXT_(2, setup, "probex%d", -ENOMEM); | ||
3295 | return -ENOMEM; | ||
3296 | } | ||
3297 | privptr->p_mtc_envelope = kzalloc(MAX_ENVELOPE_SIZE, GFP_KERNEL); | ||
3298 | privptr->p_env = kzalloc(sizeof(struct claw_env), GFP_KERNEL); | ||
3299 | if ((privptr->p_mtc_envelope == NULL) || (privptr->p_env == NULL)) { | ||
3300 | probe_error(cgdev); | ||
3301 | put_device(&cgdev->dev); | ||
3302 | CLAW_DBF_TEXT_(2, setup, "probex%d", -ENOMEM); | ||
3303 | return -ENOMEM; | ||
3304 | } | ||
3305 | memcpy(privptr->p_env->adapter_name, WS_NAME_NOT_DEF, 8); | ||
3306 | memcpy(privptr->p_env->host_name, WS_NAME_NOT_DEF, 8); | ||
3307 | memcpy(privptr->p_env->api_type, WS_NAME_NOT_DEF, 8); | ||
3308 | privptr->p_env->packing = 0; | ||
3309 | privptr->p_env->write_buffers = 5; | ||
3310 | privptr->p_env->read_buffers = 5; | ||
3311 | privptr->p_env->read_size = CLAW_FRAME_SIZE; | ||
3312 | privptr->p_env->write_size = CLAW_FRAME_SIZE; | ||
3313 | privptr->p_env->p_priv = privptr; | ||
3314 | cgdev->cdev[0]->handler = claw_irq_handler; | ||
3315 | cgdev->cdev[1]->handler = claw_irq_handler; | ||
3316 | cgdev->dev.type = &claw_devtype; | ||
3317 | CLAW_DBF_TEXT(2, setup, "prbext 0"); | ||
3318 | |||
3319 | return 0; | ||
3320 | } /* end of claw_probe */ | ||
3353 | 3321 | ||
3354 | /*--------------------------------------------------------------------* | 3322 | /*--------------------------------------------------------------------* |
3355 | * claw_init and cleanup * | 3323 | * claw_init and cleanup * |
3356 | *---------------------------------------------------------------------*/ | 3324 | *---------------------------------------------------------------------*/ |
3357 | 3325 | ||
3358 | static void __exit | 3326 | static void __exit claw_cleanup(void) |
3359 | claw_cleanup(void) | ||
3360 | { | 3327 | { |
3361 | driver_remove_file(&claw_group_driver.driver, | ||
3362 | &driver_attr_group); | ||
3363 | ccwgroup_driver_unregister(&claw_group_driver); | 3328 | ccwgroup_driver_unregister(&claw_group_driver); |
3364 | ccw_driver_unregister(&claw_ccw_driver); | 3329 | ccw_driver_unregister(&claw_ccw_driver); |
3365 | root_device_unregister(claw_root_dev); | 3330 | root_device_unregister(claw_root_dev); |
3366 | claw_unregister_debug_facility(); | 3331 | claw_unregister_debug_facility(); |
3367 | pr_info("Driver unloaded\n"); | 3332 | pr_info("Driver unloaded\n"); |
3368 | |||
3369 | } | 3333 | } |
3370 | 3334 | ||
3371 | /** | 3335 | /** |
@@ -3374,8 +3338,7 @@ claw_cleanup(void) | |||
3374 | * | 3338 | * |
3375 | * @return 0 on success, !0 on error. | 3339 | * @return 0 on success, !0 on error. |
3376 | */ | 3340 | */ |
3377 | static int __init | 3341 | static int __init claw_init(void) |
3378 | claw_init(void) | ||
3379 | { | 3342 | { |
3380 | int ret = 0; | 3343 | int ret = 0; |
3381 | 3344 | ||
@@ -3394,7 +3357,7 @@ claw_init(void) | |||
3394 | ret = ccw_driver_register(&claw_ccw_driver); | 3357 | ret = ccw_driver_register(&claw_ccw_driver); |
3395 | if (ret) | 3358 | if (ret) |
3396 | goto ccw_err; | 3359 | goto ccw_err; |
3397 | claw_group_driver.driver.groups = claw_group_attr_groups; | 3360 | claw_group_driver.driver.groups = claw_drv_attr_groups; |
3398 | ret = ccwgroup_driver_register(&claw_group_driver); | 3361 | ret = ccwgroup_driver_register(&claw_group_driver); |
3399 | if (ret) | 3362 | if (ret) |
3400 | goto ccwgroup_err; | 3363 | goto ccwgroup_err; |
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 11f3b071f305..3cd25544a27a 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c | |||
@@ -1296,6 +1296,11 @@ static void ctcm_irq_handler(struct ccw_device *cdev, | |||
1296 | 1296 | ||
1297 | } | 1297 | } |
1298 | 1298 | ||
1299 | static const struct device_type ctcm_devtype = { | ||
1300 | .name = "ctcm", | ||
1301 | .groups = ctcm_attr_groups, | ||
1302 | }; | ||
1303 | |||
1299 | /** | 1304 | /** |
1300 | * Add ctcm specific attributes. | 1305 | * Add ctcm specific attributes. |
1301 | * Add ctcm private data. | 1306 | * Add ctcm private data. |
@@ -1307,7 +1312,6 @@ static void ctcm_irq_handler(struct ccw_device *cdev, | |||
1307 | static int ctcm_probe_device(struct ccwgroup_device *cgdev) | 1312 | static int ctcm_probe_device(struct ccwgroup_device *cgdev) |
1308 | { | 1313 | { |
1309 | struct ctcm_priv *priv; | 1314 | struct ctcm_priv *priv; |
1310 | int rc; | ||
1311 | 1315 | ||
1312 | CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, | 1316 | CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, |
1313 | "%s %p", | 1317 | "%s %p", |
@@ -1324,17 +1328,11 @@ static int ctcm_probe_device(struct ccwgroup_device *cgdev) | |||
1324 | put_device(&cgdev->dev); | 1328 | put_device(&cgdev->dev); |
1325 | return -ENOMEM; | 1329 | return -ENOMEM; |
1326 | } | 1330 | } |
1327 | |||
1328 | rc = ctcm_add_files(&cgdev->dev); | ||
1329 | if (rc) { | ||
1330 | kfree(priv); | ||
1331 | put_device(&cgdev->dev); | ||
1332 | return rc; | ||
1333 | } | ||
1334 | priv->buffer_size = CTCM_BUFSIZE_DEFAULT; | 1331 | priv->buffer_size = CTCM_BUFSIZE_DEFAULT; |
1335 | cgdev->cdev[0]->handler = ctcm_irq_handler; | 1332 | cgdev->cdev[0]->handler = ctcm_irq_handler; |
1336 | cgdev->cdev[1]->handler = ctcm_irq_handler; | 1333 | cgdev->cdev[1]->handler = ctcm_irq_handler; |
1337 | dev_set_drvdata(&cgdev->dev, priv); | 1334 | dev_set_drvdata(&cgdev->dev, priv); |
1335 | cgdev->dev.type = &ctcm_devtype; | ||
1338 | 1336 | ||
1339 | return 0; | 1337 | return 0; |
1340 | } | 1338 | } |
@@ -1611,11 +1609,6 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev) | |||
1611 | goto out_dev; | 1609 | goto out_dev; |
1612 | } | 1610 | } |
1613 | 1611 | ||
1614 | if (ctcm_add_attributes(&cgdev->dev)) { | ||
1615 | result = -ENODEV; | ||
1616 | goto out_unregister; | ||
1617 | } | ||
1618 | |||
1619 | strlcpy(priv->fsm->name, dev->name, sizeof(priv->fsm->name)); | 1612 | strlcpy(priv->fsm->name, dev->name, sizeof(priv->fsm->name)); |
1620 | 1613 | ||
1621 | dev_info(&dev->dev, | 1614 | dev_info(&dev->dev, |
@@ -1629,8 +1622,6 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev) | |||
1629 | priv->channel[CTCM_WRITE]->id, priv->protocol); | 1622 | priv->channel[CTCM_WRITE]->id, priv->protocol); |
1630 | 1623 | ||
1631 | return 0; | 1624 | return 0; |
1632 | out_unregister: | ||
1633 | unregister_netdev(dev); | ||
1634 | out_dev: | 1625 | out_dev: |
1635 | ctcm_free_netdevice(dev); | 1626 | ctcm_free_netdevice(dev); |
1636 | out_ccw2: | 1627 | out_ccw2: |
@@ -1669,7 +1660,6 @@ static int ctcm_shutdown_device(struct ccwgroup_device *cgdev) | |||
1669 | /* Close the device */ | 1660 | /* Close the device */ |
1670 | ctcm_close(dev); | 1661 | ctcm_close(dev); |
1671 | dev->flags &= ~IFF_RUNNING; | 1662 | dev->flags &= ~IFF_RUNNING; |
1672 | ctcm_remove_attributes(&cgdev->dev); | ||
1673 | channel_free(priv->channel[CTCM_READ]); | 1663 | channel_free(priv->channel[CTCM_READ]); |
1674 | } else | 1664 | } else |
1675 | dev = NULL; | 1665 | dev = NULL; |
@@ -1711,7 +1701,6 @@ static void ctcm_remove_device(struct ccwgroup_device *cgdev) | |||
1711 | 1701 | ||
1712 | if (cgdev->state == CCWGROUP_ONLINE) | 1702 | if (cgdev->state == CCWGROUP_ONLINE) |
1713 | ctcm_shutdown_device(cgdev); | 1703 | ctcm_shutdown_device(cgdev); |
1714 | ctcm_remove_files(&cgdev->dev); | ||
1715 | dev_set_drvdata(&cgdev->dev, NULL); | 1704 | dev_set_drvdata(&cgdev->dev, NULL); |
1716 | kfree(priv); | 1705 | kfree(priv); |
1717 | put_device(&cgdev->dev); | 1706 | put_device(&cgdev->dev); |
@@ -1778,9 +1767,7 @@ static struct ccwgroup_driver ctcm_group_driver = { | |||
1778 | .owner = THIS_MODULE, | 1767 | .owner = THIS_MODULE, |
1779 | .name = CTC_DRIVER_NAME, | 1768 | .name = CTC_DRIVER_NAME, |
1780 | }, | 1769 | }, |
1781 | .max_slaves = 2, | 1770 | .setup = ctcm_probe_device, |
1782 | .driver_id = 0xC3E3C3D4, /* CTCM */ | ||
1783 | .probe = ctcm_probe_device, | ||
1784 | .remove = ctcm_remove_device, | 1771 | .remove = ctcm_remove_device, |
1785 | .set_online = ctcm_new_device, | 1772 | .set_online = ctcm_new_device, |
1786 | .set_offline = ctcm_shutdown_device, | 1773 | .set_offline = ctcm_shutdown_device, |
@@ -1789,31 +1776,25 @@ static struct ccwgroup_driver ctcm_group_driver = { | |||
1789 | .restore = ctcm_pm_resume, | 1776 | .restore = ctcm_pm_resume, |
1790 | }; | 1777 | }; |
1791 | 1778 | ||
1792 | static ssize_t | 1779 | static ssize_t ctcm_driver_group_store(struct device_driver *ddrv, |
1793 | ctcm_driver_group_store(struct device_driver *ddrv, const char *buf, | 1780 | const char *buf, size_t count) |
1794 | size_t count) | ||
1795 | { | 1781 | { |
1796 | int err; | 1782 | int err; |
1797 | 1783 | ||
1798 | err = ccwgroup_create_from_string(ctcm_root_dev, | 1784 | err = ccwgroup_create_dev(ctcm_root_dev, &ctcm_group_driver, 2, buf); |
1799 | ctcm_group_driver.driver_id, | ||
1800 | &ctcm_ccw_driver, 2, buf); | ||
1801 | return err ? err : count; | 1785 | return err ? err : count; |
1802 | } | 1786 | } |
1803 | |||
1804 | static DRIVER_ATTR(group, 0200, NULL, ctcm_driver_group_store); | 1787 | static DRIVER_ATTR(group, 0200, NULL, ctcm_driver_group_store); |
1805 | 1788 | ||
1806 | static struct attribute *ctcm_group_attrs[] = { | 1789 | static struct attribute *ctcm_drv_attrs[] = { |
1807 | &driver_attr_group.attr, | 1790 | &driver_attr_group.attr, |
1808 | NULL, | 1791 | NULL, |
1809 | }; | 1792 | }; |
1810 | 1793 | static struct attribute_group ctcm_drv_attr_group = { | |
1811 | static struct attribute_group ctcm_group_attr_group = { | 1794 | .attrs = ctcm_drv_attrs, |
1812 | .attrs = ctcm_group_attrs, | ||
1813 | }; | 1795 | }; |
1814 | 1796 | static const struct attribute_group *ctcm_drv_attr_groups[] = { | |
1815 | static const struct attribute_group *ctcm_group_attr_groups[] = { | 1797 | &ctcm_drv_attr_group, |
1816 | &ctcm_group_attr_group, | ||
1817 | NULL, | 1798 | NULL, |
1818 | }; | 1799 | }; |
1819 | 1800 | ||
@@ -1829,7 +1810,6 @@ static const struct attribute_group *ctcm_group_attr_groups[] = { | |||
1829 | */ | 1810 | */ |
1830 | static void __exit ctcm_exit(void) | 1811 | static void __exit ctcm_exit(void) |
1831 | { | 1812 | { |
1832 | driver_remove_file(&ctcm_group_driver.driver, &driver_attr_group); | ||
1833 | ccwgroup_driver_unregister(&ctcm_group_driver); | 1813 | ccwgroup_driver_unregister(&ctcm_group_driver); |
1834 | ccw_driver_unregister(&ctcm_ccw_driver); | 1814 | ccw_driver_unregister(&ctcm_ccw_driver); |
1835 | root_device_unregister(ctcm_root_dev); | 1815 | root_device_unregister(ctcm_root_dev); |
@@ -1867,7 +1847,7 @@ static int __init ctcm_init(void) | |||
1867 | ret = ccw_driver_register(&ctcm_ccw_driver); | 1847 | ret = ccw_driver_register(&ctcm_ccw_driver); |
1868 | if (ret) | 1848 | if (ret) |
1869 | goto ccw_err; | 1849 | goto ccw_err; |
1870 | ctcm_group_driver.driver.groups = ctcm_group_attr_groups; | 1850 | ctcm_group_driver.driver.groups = ctcm_drv_attr_groups; |
1871 | ret = ccwgroup_driver_register(&ctcm_group_driver); | 1851 | ret = ccwgroup_driver_register(&ctcm_group_driver); |
1872 | if (ret) | 1852 | if (ret) |
1873 | goto ccwgroup_err; | 1853 | goto ccwgroup_err; |
diff --git a/drivers/s390/net/ctcm_main.h b/drivers/s390/net/ctcm_main.h index 24d5215eb0c4..b9056a55d995 100644 --- a/drivers/s390/net/ctcm_main.h +++ b/drivers/s390/net/ctcm_main.h | |||
@@ -225,13 +225,7 @@ struct ctcm_priv { | |||
225 | int ctcm_open(struct net_device *dev); | 225 | int ctcm_open(struct net_device *dev); |
226 | int ctcm_close(struct net_device *dev); | 226 | int ctcm_close(struct net_device *dev); |
227 | 227 | ||
228 | /* | 228 | extern const struct attribute_group *ctcm_attr_groups[]; |
229 | * prototypes for non-static sysfs functions | ||
230 | */ | ||
231 | int ctcm_add_attributes(struct device *dev); | ||
232 | void ctcm_remove_attributes(struct device *dev); | ||
233 | int ctcm_add_files(struct device *dev); | ||
234 | void ctcm_remove_files(struct device *dev); | ||
235 | 229 | ||
236 | /* | 230 | /* |
237 | * Compatibility macros for busy handling | 231 | * Compatibility macros for busy handling |
diff --git a/drivers/s390/net/ctcm_sysfs.c b/drivers/s390/net/ctcm_sysfs.c index 650aec1839e9..0c27ae726475 100644 --- a/drivers/s390/net/ctcm_sysfs.c +++ b/drivers/s390/net/ctcm_sysfs.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #define KMSG_COMPONENT "ctcm" | 13 | #define KMSG_COMPONENT "ctcm" |
14 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 14 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
15 | 15 | ||
16 | #include <linux/device.h> | ||
16 | #include <linux/sysfs.h> | 17 | #include <linux/sysfs.h> |
17 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
18 | #include "ctcm_main.h" | 19 | #include "ctcm_main.h" |
@@ -108,10 +109,12 @@ static void ctcm_print_statistics(struct ctcm_priv *priv) | |||
108 | } | 109 | } |
109 | 110 | ||
110 | static ssize_t stats_show(struct device *dev, | 111 | static ssize_t stats_show(struct device *dev, |
111 | struct device_attribute *attr, char *buf) | 112 | struct device_attribute *attr, char *buf) |
112 | { | 113 | { |
114 | struct ccwgroup_device *gdev = to_ccwgroupdev(dev); | ||
113 | struct ctcm_priv *priv = dev_get_drvdata(dev); | 115 | struct ctcm_priv *priv = dev_get_drvdata(dev); |
114 | if (!priv) | 116 | |
117 | if (!priv || gdev->state != CCWGROUP_ONLINE) | ||
115 | return -ENODEV; | 118 | return -ENODEV; |
116 | ctcm_print_statistics(priv); | 119 | ctcm_print_statistics(priv); |
117 | return sprintf(buf, "0\n"); | 120 | return sprintf(buf, "0\n"); |
@@ -190,34 +193,14 @@ static struct attribute *ctcm_attr[] = { | |||
190 | &dev_attr_protocol.attr, | 193 | &dev_attr_protocol.attr, |
191 | &dev_attr_type.attr, | 194 | &dev_attr_type.attr, |
192 | &dev_attr_buffer.attr, | 195 | &dev_attr_buffer.attr, |
196 | &dev_attr_stats.attr, | ||
193 | NULL, | 197 | NULL, |
194 | }; | 198 | }; |
195 | 199 | ||
196 | static struct attribute_group ctcm_attr_group = { | 200 | static struct attribute_group ctcm_attr_group = { |
197 | .attrs = ctcm_attr, | 201 | .attrs = ctcm_attr, |
198 | }; | 202 | }; |
199 | 203 | const struct attribute_group *ctcm_attr_groups[] = { | |
200 | int ctcm_add_attributes(struct device *dev) | 204 | &ctcm_attr_group, |
201 | { | 205 | NULL, |
202 | int rc; | 206 | }; |
203 | |||
204 | rc = device_create_file(dev, &dev_attr_stats); | ||
205 | |||
206 | return rc; | ||
207 | } | ||
208 | |||
209 | void ctcm_remove_attributes(struct device *dev) | ||
210 | { | ||
211 | device_remove_file(dev, &dev_attr_stats); | ||
212 | } | ||
213 | |||
214 | int ctcm_add_files(struct device *dev) | ||
215 | { | ||
216 | return sysfs_create_group(&dev->kobj, &ctcm_attr_group); | ||
217 | } | ||
218 | |||
219 | void ctcm_remove_files(struct device *dev) | ||
220 | { | ||
221 | sysfs_remove_group(&dev->kobj, &ctcm_attr_group); | ||
222 | } | ||
223 | |||
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index 6056cf6da035..a3adf4b1c60d 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c | |||
@@ -2040,10 +2040,17 @@ static struct attribute * lcs_attrs[] = { | |||
2040 | &dev_attr_recover.attr, | 2040 | &dev_attr_recover.attr, |
2041 | NULL, | 2041 | NULL, |
2042 | }; | 2042 | }; |
2043 | |||
2044 | static struct attribute_group lcs_attr_group = { | 2043 | static struct attribute_group lcs_attr_group = { |
2045 | .attrs = lcs_attrs, | 2044 | .attrs = lcs_attrs, |
2046 | }; | 2045 | }; |
2046 | static const struct attribute_group *lcs_attr_groups[] = { | ||
2047 | &lcs_attr_group, | ||
2048 | NULL, | ||
2049 | }; | ||
2050 | static const struct device_type lcs_devtype = { | ||
2051 | .name = "lcs", | ||
2052 | .groups = lcs_attr_groups, | ||
2053 | }; | ||
2047 | 2054 | ||
2048 | /** | 2055 | /** |
2049 | * lcs_probe_device is called on establishing a new ccwgroup_device. | 2056 | * lcs_probe_device is called on establishing a new ccwgroup_device. |
@@ -2052,7 +2059,6 @@ static int | |||
2052 | lcs_probe_device(struct ccwgroup_device *ccwgdev) | 2059 | lcs_probe_device(struct ccwgroup_device *ccwgdev) |
2053 | { | 2060 | { |
2054 | struct lcs_card *card; | 2061 | struct lcs_card *card; |
2055 | int ret; | ||
2056 | 2062 | ||
2057 | if (!get_device(&ccwgdev->dev)) | 2063 | if (!get_device(&ccwgdev->dev)) |
2058 | return -ENODEV; | 2064 | return -ENODEV; |
@@ -2064,12 +2070,6 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev) | |||
2064 | put_device(&ccwgdev->dev); | 2070 | put_device(&ccwgdev->dev); |
2065 | return -ENOMEM; | 2071 | return -ENOMEM; |
2066 | } | 2072 | } |
2067 | ret = sysfs_create_group(&ccwgdev->dev.kobj, &lcs_attr_group); | ||
2068 | if (ret) { | ||
2069 | lcs_free_card(card); | ||
2070 | put_device(&ccwgdev->dev); | ||
2071 | return ret; | ||
2072 | } | ||
2073 | dev_set_drvdata(&ccwgdev->dev, card); | 2073 | dev_set_drvdata(&ccwgdev->dev, card); |
2074 | ccwgdev->cdev[0]->handler = lcs_irq; | 2074 | ccwgdev->cdev[0]->handler = lcs_irq; |
2075 | ccwgdev->cdev[1]->handler = lcs_irq; | 2075 | ccwgdev->cdev[1]->handler = lcs_irq; |
@@ -2078,7 +2078,9 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev) | |||
2078 | card->thread_start_mask = 0; | 2078 | card->thread_start_mask = 0; |
2079 | card->thread_allowed_mask = 0; | 2079 | card->thread_allowed_mask = 0; |
2080 | card->thread_running_mask = 0; | 2080 | card->thread_running_mask = 0; |
2081 | return 0; | 2081 | ccwgdev->dev.type = &lcs_devtype; |
2082 | |||
2083 | return 0; | ||
2082 | } | 2084 | } |
2083 | 2085 | ||
2084 | static int | 2086 | static int |
@@ -2306,9 +2308,9 @@ lcs_remove_device(struct ccwgroup_device *ccwgdev) | |||
2306 | } | 2308 | } |
2307 | if (card->dev) | 2309 | if (card->dev) |
2308 | unregister_netdev(card->dev); | 2310 | unregister_netdev(card->dev); |
2309 | sysfs_remove_group(&ccwgdev->dev.kobj, &lcs_attr_group); | ||
2310 | lcs_cleanup_card(card); | 2311 | lcs_cleanup_card(card); |
2311 | lcs_free_card(card); | 2312 | lcs_free_card(card); |
2313 | dev_set_drvdata(&ccwgdev->dev, NULL); | ||
2312 | put_device(&ccwgdev->dev); | 2314 | put_device(&ccwgdev->dev); |
2313 | } | 2315 | } |
2314 | 2316 | ||
@@ -2393,9 +2395,7 @@ static struct ccwgroup_driver lcs_group_driver = { | |||
2393 | .owner = THIS_MODULE, | 2395 | .owner = THIS_MODULE, |
2394 | .name = "lcs", | 2396 | .name = "lcs", |
2395 | }, | 2397 | }, |
2396 | .max_slaves = 2, | 2398 | .setup = lcs_probe_device, |
2397 | .driver_id = 0xD3C3E2, | ||
2398 | .probe = lcs_probe_device, | ||
2399 | .remove = lcs_remove_device, | 2399 | .remove = lcs_remove_device, |
2400 | .set_online = lcs_new_device, | 2400 | .set_online = lcs_new_device, |
2401 | .set_offline = lcs_shutdown_device, | 2401 | .set_offline = lcs_shutdown_device, |
@@ -2406,30 +2406,24 @@ static struct ccwgroup_driver lcs_group_driver = { | |||
2406 | .restore = lcs_restore, | 2406 | .restore = lcs_restore, |
2407 | }; | 2407 | }; |
2408 | 2408 | ||
2409 | static ssize_t | 2409 | static ssize_t lcs_driver_group_store(struct device_driver *ddrv, |
2410 | lcs_driver_group_store(struct device_driver *ddrv, const char *buf, | 2410 | const char *buf, size_t count) |
2411 | size_t count) | ||
2412 | { | 2411 | { |
2413 | int err; | 2412 | int err; |
2414 | err = ccwgroup_create_from_string(lcs_root_dev, | 2413 | err = ccwgroup_create_dev(lcs_root_dev, &lcs_group_driver, 2, buf); |
2415 | lcs_group_driver.driver_id, | ||
2416 | &lcs_ccw_driver, 2, buf); | ||
2417 | return err ? err : count; | 2414 | return err ? err : count; |
2418 | } | 2415 | } |
2419 | |||
2420 | static DRIVER_ATTR(group, 0200, NULL, lcs_driver_group_store); | 2416 | static DRIVER_ATTR(group, 0200, NULL, lcs_driver_group_store); |
2421 | 2417 | ||
2422 | static struct attribute *lcs_group_attrs[] = { | 2418 | static struct attribute *lcs_drv_attrs[] = { |
2423 | &driver_attr_group.attr, | 2419 | &driver_attr_group.attr, |
2424 | NULL, | 2420 | NULL, |
2425 | }; | 2421 | }; |
2426 | 2422 | static struct attribute_group lcs_drv_attr_group = { | |
2427 | static struct attribute_group lcs_group_attr_group = { | 2423 | .attrs = lcs_drv_attrs, |
2428 | .attrs = lcs_group_attrs, | ||
2429 | }; | 2424 | }; |
2430 | 2425 | static const struct attribute_group *lcs_drv_attr_groups[] = { | |
2431 | static const struct attribute_group *lcs_group_attr_groups[] = { | 2426 | &lcs_drv_attr_group, |
2432 | &lcs_group_attr_group, | ||
2433 | NULL, | 2427 | NULL, |
2434 | }; | 2428 | }; |
2435 | 2429 | ||
@@ -2453,7 +2447,7 @@ __init lcs_init_module(void) | |||
2453 | rc = ccw_driver_register(&lcs_ccw_driver); | 2447 | rc = ccw_driver_register(&lcs_ccw_driver); |
2454 | if (rc) | 2448 | if (rc) |
2455 | goto ccw_err; | 2449 | goto ccw_err; |
2456 | lcs_group_driver.driver.groups = lcs_group_attr_groups; | 2450 | lcs_group_driver.driver.groups = lcs_drv_attr_groups; |
2457 | rc = ccwgroup_driver_register(&lcs_group_driver); | 2451 | rc = ccwgroup_driver_register(&lcs_group_driver); |
2458 | if (rc) | 2452 | if (rc) |
2459 | goto ccwgroup_err; | 2453 | goto ccwgroup_err; |
@@ -2479,8 +2473,6 @@ __exit lcs_cleanup_module(void) | |||
2479 | { | 2473 | { |
2480 | pr_info("Terminating lcs module.\n"); | 2474 | pr_info("Terminating lcs module.\n"); |
2481 | LCS_DBF_TEXT(0, trace, "cleanup"); | 2475 | LCS_DBF_TEXT(0, trace, "cleanup"); |
2482 | driver_remove_file(&lcs_group_driver.driver, | ||
2483 | &driver_attr_group); | ||
2484 | ccwgroup_driver_unregister(&lcs_group_driver); | 2476 | ccwgroup_driver_unregister(&lcs_group_driver); |
2485 | ccw_driver_unregister(&lcs_ccw_driver); | 2477 | ccw_driver_unregister(&lcs_ccw_driver); |
2486 | root_device_unregister(lcs_root_dev); | 2478 | root_device_unregister(lcs_root_dev); |
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 40285dc9ae5c..06e8f31ff3dc 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h | |||
@@ -707,7 +707,16 @@ struct qeth_discipline { | |||
707 | qdio_handler_t *input_handler; | 707 | qdio_handler_t *input_handler; |
708 | qdio_handler_t *output_handler; | 708 | qdio_handler_t *output_handler; |
709 | int (*recover)(void *ptr); | 709 | int (*recover)(void *ptr); |
710 | struct ccwgroup_driver *ccwgdriver; | 710 | int (*setup) (struct ccwgroup_device *); |
711 | void (*remove) (struct ccwgroup_device *); | ||
712 | int (*set_online) (struct ccwgroup_device *); | ||
713 | int (*set_offline) (struct ccwgroup_device *); | ||
714 | void (*shutdown)(struct ccwgroup_device *); | ||
715 | int (*prepare) (struct ccwgroup_device *); | ||
716 | void (*complete) (struct ccwgroup_device *); | ||
717 | int (*freeze)(struct ccwgroup_device *); | ||
718 | int (*thaw) (struct ccwgroup_device *); | ||
719 | int (*restore)(struct ccwgroup_device *); | ||
711 | }; | 720 | }; |
712 | 721 | ||
713 | struct qeth_vlan_vid { | 722 | struct qeth_vlan_vid { |
@@ -771,7 +780,7 @@ struct qeth_card { | |||
771 | struct qeth_perf_stats perf_stats; | 780 | struct qeth_perf_stats perf_stats; |
772 | int read_or_write_problem; | 781 | int read_or_write_problem; |
773 | struct qeth_osn_info osn_info; | 782 | struct qeth_osn_info osn_info; |
774 | struct qeth_discipline discipline; | 783 | struct qeth_discipline *discipline; |
775 | atomic_t force_alloc_skb; | 784 | atomic_t force_alloc_skb; |
776 | struct service_level qeth_service_level; | 785 | struct service_level qeth_service_level; |
777 | struct qdio_ssqd_desc ssqd; | 786 | struct qdio_ssqd_desc ssqd; |
@@ -837,16 +846,15 @@ static inline int qeth_is_diagass_supported(struct qeth_card *card, | |||
837 | return card->info.diagass_support & (__u32)cmd; | 846 | return card->info.diagass_support & (__u32)cmd; |
838 | } | 847 | } |
839 | 848 | ||
840 | extern struct ccwgroup_driver qeth_l2_ccwgroup_driver; | 849 | extern struct qeth_discipline qeth_l2_discipline; |
841 | extern struct ccwgroup_driver qeth_l3_ccwgroup_driver; | 850 | extern struct qeth_discipline qeth_l3_discipline; |
851 | extern const struct attribute_group *qeth_generic_attr_groups[]; | ||
852 | extern const struct attribute_group *qeth_osn_attr_groups[]; | ||
853 | |||
842 | const char *qeth_get_cardname_short(struct qeth_card *); | 854 | const char *qeth_get_cardname_short(struct qeth_card *); |
843 | int qeth_realloc_buffer_pool(struct qeth_card *, int); | 855 | int qeth_realloc_buffer_pool(struct qeth_card *, int); |
844 | int qeth_core_load_discipline(struct qeth_card *, enum qeth_discipline_id); | 856 | int qeth_core_load_discipline(struct qeth_card *, enum qeth_discipline_id); |
845 | void qeth_core_free_discipline(struct qeth_card *); | 857 | void qeth_core_free_discipline(struct qeth_card *); |
846 | int qeth_core_create_device_attributes(struct device *); | ||
847 | void qeth_core_remove_device_attributes(struct device *); | ||
848 | int qeth_core_create_osn_attributes(struct device *); | ||
849 | void qeth_core_remove_osn_attributes(struct device *); | ||
850 | void qeth_buffer_reclaim_work(struct work_struct *); | 858 | void qeth_buffer_reclaim_work(struct work_struct *); |
851 | 859 | ||
852 | /* exports for qeth discipline device drivers */ | 860 | /* exports for qeth discipline device drivers */ |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index e000001539bf..e118e1e1e1c1 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -1363,7 +1363,7 @@ static void qeth_start_kernel_thread(struct work_struct *work) | |||
1363 | card->write.state != CH_STATE_UP) | 1363 | card->write.state != CH_STATE_UP) |
1364 | return; | 1364 | return; |
1365 | if (qeth_do_start_thread(card, QETH_RECOVER_THREAD)) { | 1365 | if (qeth_do_start_thread(card, QETH_RECOVER_THREAD)) { |
1366 | ts = kthread_run(card->discipline.recover, (void *)card, | 1366 | ts = kthread_run(card->discipline->recover, (void *)card, |
1367 | "qeth_recover"); | 1367 | "qeth_recover"); |
1368 | if (IS_ERR(ts)) { | 1368 | if (IS_ERR(ts)) { |
1369 | qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); | 1369 | qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); |
@@ -3337,7 +3337,7 @@ static void qeth_flush_buffers(struct qeth_qdio_out_q *queue, int index, | |||
3337 | if (rc) { | 3337 | if (rc) { |
3338 | queue->card->stats.tx_errors += count; | 3338 | queue->card->stats.tx_errors += count; |
3339 | /* ignore temporary SIGA errors without busy condition */ | 3339 | /* ignore temporary SIGA errors without busy condition */ |
3340 | if (rc == QDIO_ERROR_SIGA_TARGET) | 3340 | if (rc == -ENOBUFS) |
3341 | return; | 3341 | return; |
3342 | QETH_CARD_TEXT(queue->card, 2, "flushbuf"); | 3342 | QETH_CARD_TEXT(queue->card, 2, "flushbuf"); |
3343 | QETH_CARD_TEXT_(queue->card, 2, " q%d", queue->queue_no); | 3343 | QETH_CARD_TEXT_(queue->card, 2, " q%d", queue->queue_no); |
@@ -3531,7 +3531,7 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev, | |||
3531 | int i; | 3531 | int i; |
3532 | 3532 | ||
3533 | QETH_CARD_TEXT(card, 6, "qdouhdl"); | 3533 | QETH_CARD_TEXT(card, 6, "qdouhdl"); |
3534 | if (qdio_error & QDIO_ERROR_ACTIVATE_CHECK_CONDITION) { | 3534 | if (qdio_error & QDIO_ERROR_FATAL) { |
3535 | QETH_CARD_TEXT(card, 2, "achkcond"); | 3535 | QETH_CARD_TEXT(card, 2, "achkcond"); |
3536 | netif_stop_queue(card->dev); | 3536 | netif_stop_queue(card->dev); |
3537 | qeth_schedule_recovery(card); | 3537 | qeth_schedule_recovery(card); |
@@ -4627,7 +4627,7 @@ static int qeth_qdio_establish(struct qeth_card *card) | |||
4627 | goto out_free_in_sbals; | 4627 | goto out_free_in_sbals; |
4628 | } | 4628 | } |
4629 | for (i = 0; i < card->qdio.no_in_queues; ++i) | 4629 | for (i = 0; i < card->qdio.no_in_queues; ++i) |
4630 | queue_start_poll[i] = card->discipline.start_poll; | 4630 | queue_start_poll[i] = card->discipline->start_poll; |
4631 | 4631 | ||
4632 | qeth_qdio_establish_cq(card, in_sbal_ptrs, queue_start_poll); | 4632 | qeth_qdio_establish_cq(card, in_sbal_ptrs, queue_start_poll); |
4633 | 4633 | ||
@@ -4651,8 +4651,8 @@ static int qeth_qdio_establish(struct qeth_card *card) | |||
4651 | init_data.qib_param_field = qib_param_field; | 4651 | init_data.qib_param_field = qib_param_field; |
4652 | init_data.no_input_qs = card->qdio.no_in_queues; | 4652 | init_data.no_input_qs = card->qdio.no_in_queues; |
4653 | init_data.no_output_qs = card->qdio.no_out_queues; | 4653 | init_data.no_output_qs = card->qdio.no_out_queues; |
4654 | init_data.input_handler = card->discipline.input_handler; | 4654 | init_data.input_handler = card->discipline->input_handler; |
4655 | init_data.output_handler = card->discipline.output_handler; | 4655 | init_data.output_handler = card->discipline->output_handler; |
4656 | init_data.queue_start_poll_array = queue_start_poll; | 4656 | init_data.queue_start_poll_array = queue_start_poll; |
4657 | init_data.int_parm = (unsigned long) card; | 4657 | init_data.int_parm = (unsigned long) card; |
4658 | init_data.input_sbal_addr_array = (void **) in_sbal_ptrs; | 4658 | init_data.input_sbal_addr_array = (void **) in_sbal_ptrs; |
@@ -4737,13 +4737,6 @@ static struct ccw_driver qeth_ccw_driver = { | |||
4737 | .remove = ccwgroup_remove_ccwdev, | 4737 | .remove = ccwgroup_remove_ccwdev, |
4738 | }; | 4738 | }; |
4739 | 4739 | ||
4740 | static int qeth_core_driver_group(const char *buf, struct device *root_dev, | ||
4741 | unsigned long driver_id) | ||
4742 | { | ||
4743 | return ccwgroup_create_from_string(root_dev, driver_id, | ||
4744 | &qeth_ccw_driver, 3, buf); | ||
4745 | } | ||
4746 | |||
4747 | int qeth_core_hardsetup_card(struct qeth_card *card) | 4740 | int qeth_core_hardsetup_card(struct qeth_card *card) |
4748 | { | 4741 | { |
4749 | int retries = 0; | 4742 | int retries = 0; |
@@ -5040,17 +5033,15 @@ int qeth_core_load_discipline(struct qeth_card *card, | |||
5040 | mutex_lock(&qeth_mod_mutex); | 5033 | mutex_lock(&qeth_mod_mutex); |
5041 | switch (discipline) { | 5034 | switch (discipline) { |
5042 | case QETH_DISCIPLINE_LAYER3: | 5035 | case QETH_DISCIPLINE_LAYER3: |
5043 | card->discipline.ccwgdriver = try_then_request_module( | 5036 | card->discipline = try_then_request_module( |
5044 | symbol_get(qeth_l3_ccwgroup_driver), | 5037 | symbol_get(qeth_l3_discipline), "qeth_l3"); |
5045 | "qeth_l3"); | ||
5046 | break; | 5038 | break; |
5047 | case QETH_DISCIPLINE_LAYER2: | 5039 | case QETH_DISCIPLINE_LAYER2: |
5048 | card->discipline.ccwgdriver = try_then_request_module( | 5040 | card->discipline = try_then_request_module( |
5049 | symbol_get(qeth_l2_ccwgroup_driver), | 5041 | symbol_get(qeth_l2_discipline), "qeth_l2"); |
5050 | "qeth_l2"); | ||
5051 | break; | 5042 | break; |
5052 | } | 5043 | } |
5053 | if (!card->discipline.ccwgdriver) { | 5044 | if (!card->discipline) { |
5054 | dev_err(&card->gdev->dev, "There is no kernel module to " | 5045 | dev_err(&card->gdev->dev, "There is no kernel module to " |
5055 | "support discipline %d\n", discipline); | 5046 | "support discipline %d\n", discipline); |
5056 | rc = -EINVAL; | 5047 | rc = -EINVAL; |
@@ -5062,12 +5053,21 @@ int qeth_core_load_discipline(struct qeth_card *card, | |||
5062 | void qeth_core_free_discipline(struct qeth_card *card) | 5053 | void qeth_core_free_discipline(struct qeth_card *card) |
5063 | { | 5054 | { |
5064 | if (card->options.layer2) | 5055 | if (card->options.layer2) |
5065 | symbol_put(qeth_l2_ccwgroup_driver); | 5056 | symbol_put(qeth_l2_discipline); |
5066 | else | 5057 | else |
5067 | symbol_put(qeth_l3_ccwgroup_driver); | 5058 | symbol_put(qeth_l3_discipline); |
5068 | card->discipline.ccwgdriver = NULL; | 5059 | card->discipline = NULL; |
5069 | } | 5060 | } |
5070 | 5061 | ||
5062 | static const struct device_type qeth_generic_devtype = { | ||
5063 | .name = "qeth_generic", | ||
5064 | .groups = qeth_generic_attr_groups, | ||
5065 | }; | ||
5066 | static const struct device_type qeth_osn_devtype = { | ||
5067 | .name = "qeth_osn", | ||
5068 | .groups = qeth_osn_attr_groups, | ||
5069 | }; | ||
5070 | |||
5071 | static int qeth_core_probe_device(struct ccwgroup_device *gdev) | 5071 | static int qeth_core_probe_device(struct ccwgroup_device *gdev) |
5072 | { | 5072 | { |
5073 | struct qeth_card *card; | 5073 | struct qeth_card *card; |
@@ -5122,18 +5122,17 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev) | |||
5122 | } | 5122 | } |
5123 | 5123 | ||
5124 | if (card->info.type == QETH_CARD_TYPE_OSN) | 5124 | if (card->info.type == QETH_CARD_TYPE_OSN) |
5125 | rc = qeth_core_create_osn_attributes(dev); | 5125 | gdev->dev.type = &qeth_osn_devtype; |
5126 | else | 5126 | else |
5127 | rc = qeth_core_create_device_attributes(dev); | 5127 | gdev->dev.type = &qeth_generic_devtype; |
5128 | if (rc) | 5128 | |
5129 | goto err_dbf; | ||
5130 | switch (card->info.type) { | 5129 | switch (card->info.type) { |
5131 | case QETH_CARD_TYPE_OSN: | 5130 | case QETH_CARD_TYPE_OSN: |
5132 | case QETH_CARD_TYPE_OSM: | 5131 | case QETH_CARD_TYPE_OSM: |
5133 | rc = qeth_core_load_discipline(card, QETH_DISCIPLINE_LAYER2); | 5132 | rc = qeth_core_load_discipline(card, QETH_DISCIPLINE_LAYER2); |
5134 | if (rc) | 5133 | if (rc) |
5135 | goto err_attr; | 5134 | goto err_dbf; |
5136 | rc = card->discipline.ccwgdriver->probe(card->gdev); | 5135 | rc = card->discipline->setup(card->gdev); |
5137 | if (rc) | 5136 | if (rc) |
5138 | goto err_disc; | 5137 | goto err_disc; |
5139 | case QETH_CARD_TYPE_OSD: | 5138 | case QETH_CARD_TYPE_OSD: |
@@ -5151,11 +5150,6 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev) | |||
5151 | 5150 | ||
5152 | err_disc: | 5151 | err_disc: |
5153 | qeth_core_free_discipline(card); | 5152 | qeth_core_free_discipline(card); |
5154 | err_attr: | ||
5155 | if (card->info.type == QETH_CARD_TYPE_OSN) | ||
5156 | qeth_core_remove_osn_attributes(dev); | ||
5157 | else | ||
5158 | qeth_core_remove_device_attributes(dev); | ||
5159 | err_dbf: | 5153 | err_dbf: |
5160 | debug_unregister(card->debug); | 5154 | debug_unregister(card->debug); |
5161 | err_card: | 5155 | err_card: |
@@ -5172,14 +5166,8 @@ static void qeth_core_remove_device(struct ccwgroup_device *gdev) | |||
5172 | 5166 | ||
5173 | QETH_DBF_TEXT(SETUP, 2, "removedv"); | 5167 | QETH_DBF_TEXT(SETUP, 2, "removedv"); |
5174 | 5168 | ||
5175 | if (card->info.type == QETH_CARD_TYPE_OSN) { | 5169 | if (card->discipline) { |
5176 | qeth_core_remove_osn_attributes(&gdev->dev); | 5170 | card->discipline->remove(gdev); |
5177 | } else { | ||
5178 | qeth_core_remove_device_attributes(&gdev->dev); | ||
5179 | } | ||
5180 | |||
5181 | if (card->discipline.ccwgdriver) { | ||
5182 | card->discipline.ccwgdriver->remove(gdev); | ||
5183 | qeth_core_free_discipline(card); | 5171 | qeth_core_free_discipline(card); |
5184 | } | 5172 | } |
5185 | 5173 | ||
@@ -5199,7 +5187,7 @@ static int qeth_core_set_online(struct ccwgroup_device *gdev) | |||
5199 | int rc = 0; | 5187 | int rc = 0; |
5200 | int def_discipline; | 5188 | int def_discipline; |
5201 | 5189 | ||
5202 | if (!card->discipline.ccwgdriver) { | 5190 | if (!card->discipline) { |
5203 | if (card->info.type == QETH_CARD_TYPE_IQD) | 5191 | if (card->info.type == QETH_CARD_TYPE_IQD) |
5204 | def_discipline = QETH_DISCIPLINE_LAYER3; | 5192 | def_discipline = QETH_DISCIPLINE_LAYER3; |
5205 | else | 5193 | else |
@@ -5207,11 +5195,11 @@ static int qeth_core_set_online(struct ccwgroup_device *gdev) | |||
5207 | rc = qeth_core_load_discipline(card, def_discipline); | 5195 | rc = qeth_core_load_discipline(card, def_discipline); |
5208 | if (rc) | 5196 | if (rc) |
5209 | goto err; | 5197 | goto err; |
5210 | rc = card->discipline.ccwgdriver->probe(card->gdev); | 5198 | rc = card->discipline->setup(card->gdev); |
5211 | if (rc) | 5199 | if (rc) |
5212 | goto err; | 5200 | goto err; |
5213 | } | 5201 | } |
5214 | rc = card->discipline.ccwgdriver->set_online(gdev); | 5202 | rc = card->discipline->set_online(gdev); |
5215 | err: | 5203 | err: |
5216 | return rc; | 5204 | return rc; |
5217 | } | 5205 | } |
@@ -5219,58 +5207,52 @@ err: | |||
5219 | static int qeth_core_set_offline(struct ccwgroup_device *gdev) | 5207 | static int qeth_core_set_offline(struct ccwgroup_device *gdev) |
5220 | { | 5208 | { |
5221 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); | 5209 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); |
5222 | return card->discipline.ccwgdriver->set_offline(gdev); | 5210 | return card->discipline->set_offline(gdev); |
5223 | } | 5211 | } |
5224 | 5212 | ||
5225 | static void qeth_core_shutdown(struct ccwgroup_device *gdev) | 5213 | static void qeth_core_shutdown(struct ccwgroup_device *gdev) |
5226 | { | 5214 | { |
5227 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); | 5215 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); |
5228 | if (card->discipline.ccwgdriver && | 5216 | if (card->discipline && card->discipline->shutdown) |
5229 | card->discipline.ccwgdriver->shutdown) | 5217 | card->discipline->shutdown(gdev); |
5230 | card->discipline.ccwgdriver->shutdown(gdev); | ||
5231 | } | 5218 | } |
5232 | 5219 | ||
5233 | static int qeth_core_prepare(struct ccwgroup_device *gdev) | 5220 | static int qeth_core_prepare(struct ccwgroup_device *gdev) |
5234 | { | 5221 | { |
5235 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); | 5222 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); |
5236 | if (card->discipline.ccwgdriver && | 5223 | if (card->discipline && card->discipline->prepare) |
5237 | card->discipline.ccwgdriver->prepare) | 5224 | return card->discipline->prepare(gdev); |
5238 | return card->discipline.ccwgdriver->prepare(gdev); | ||
5239 | return 0; | 5225 | return 0; |
5240 | } | 5226 | } |
5241 | 5227 | ||
5242 | static void qeth_core_complete(struct ccwgroup_device *gdev) | 5228 | static void qeth_core_complete(struct ccwgroup_device *gdev) |
5243 | { | 5229 | { |
5244 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); | 5230 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); |
5245 | if (card->discipline.ccwgdriver && | 5231 | if (card->discipline && card->discipline->complete) |
5246 | card->discipline.ccwgdriver->complete) | 5232 | card->discipline->complete(gdev); |
5247 | card->discipline.ccwgdriver->complete(gdev); | ||
5248 | } | 5233 | } |
5249 | 5234 | ||
5250 | static int qeth_core_freeze(struct ccwgroup_device *gdev) | 5235 | static int qeth_core_freeze(struct ccwgroup_device *gdev) |
5251 | { | 5236 | { |
5252 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); | 5237 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); |
5253 | if (card->discipline.ccwgdriver && | 5238 | if (card->discipline && card->discipline->freeze) |
5254 | card->discipline.ccwgdriver->freeze) | 5239 | return card->discipline->freeze(gdev); |
5255 | return card->discipline.ccwgdriver->freeze(gdev); | ||
5256 | return 0; | 5240 | return 0; |
5257 | } | 5241 | } |
5258 | 5242 | ||
5259 | static int qeth_core_thaw(struct ccwgroup_device *gdev) | 5243 | static int qeth_core_thaw(struct ccwgroup_device *gdev) |
5260 | { | 5244 | { |
5261 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); | 5245 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); |
5262 | if (card->discipline.ccwgdriver && | 5246 | if (card->discipline && card->discipline->thaw) |
5263 | card->discipline.ccwgdriver->thaw) | 5247 | return card->discipline->thaw(gdev); |
5264 | return card->discipline.ccwgdriver->thaw(gdev); | ||
5265 | return 0; | 5248 | return 0; |
5266 | } | 5249 | } |
5267 | 5250 | ||
5268 | static int qeth_core_restore(struct ccwgroup_device *gdev) | 5251 | static int qeth_core_restore(struct ccwgroup_device *gdev) |
5269 | { | 5252 | { |
5270 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); | 5253 | struct qeth_card *card = dev_get_drvdata(&gdev->dev); |
5271 | if (card->discipline.ccwgdriver && | 5254 | if (card->discipline && card->discipline->restore) |
5272 | card->discipline.ccwgdriver->restore) | 5255 | return card->discipline->restore(gdev); |
5273 | return card->discipline.ccwgdriver->restore(gdev); | ||
5274 | return 0; | 5256 | return 0; |
5275 | } | 5257 | } |
5276 | 5258 | ||
@@ -5279,8 +5261,7 @@ static struct ccwgroup_driver qeth_core_ccwgroup_driver = { | |||
5279 | .owner = THIS_MODULE, | 5261 | .owner = THIS_MODULE, |
5280 | .name = "qeth", | 5262 | .name = "qeth", |
5281 | }, | 5263 | }, |
5282 | .driver_id = 0xD8C5E3C8, | 5264 | .setup = qeth_core_probe_device, |
5283 | .probe = qeth_core_probe_device, | ||
5284 | .remove = qeth_core_remove_device, | 5265 | .remove = qeth_core_remove_device, |
5285 | .set_online = qeth_core_set_online, | 5266 | .set_online = qeth_core_set_online, |
5286 | .set_offline = qeth_core_set_offline, | 5267 | .set_offline = qeth_core_set_offline, |
@@ -5292,21 +5273,30 @@ static struct ccwgroup_driver qeth_core_ccwgroup_driver = { | |||
5292 | .restore = qeth_core_restore, | 5273 | .restore = qeth_core_restore, |
5293 | }; | 5274 | }; |
5294 | 5275 | ||
5295 | static ssize_t | 5276 | static ssize_t qeth_core_driver_group_store(struct device_driver *ddrv, |
5296 | qeth_core_driver_group_store(struct device_driver *ddrv, const char *buf, | 5277 | const char *buf, size_t count) |
5297 | size_t count) | ||
5298 | { | 5278 | { |
5299 | int err; | 5279 | int err; |
5300 | err = qeth_core_driver_group(buf, qeth_core_root_dev, | ||
5301 | qeth_core_ccwgroup_driver.driver_id); | ||
5302 | if (err) | ||
5303 | return err; | ||
5304 | else | ||
5305 | return count; | ||
5306 | } | ||
5307 | 5280 | ||
5281 | err = ccwgroup_create_dev(qeth_core_root_dev, | ||
5282 | &qeth_core_ccwgroup_driver, 3, buf); | ||
5283 | |||
5284 | return err ? err : count; | ||
5285 | } | ||
5308 | static DRIVER_ATTR(group, 0200, NULL, qeth_core_driver_group_store); | 5286 | static DRIVER_ATTR(group, 0200, NULL, qeth_core_driver_group_store); |
5309 | 5287 | ||
5288 | static struct attribute *qeth_drv_attrs[] = { | ||
5289 | &driver_attr_group.attr, | ||
5290 | NULL, | ||
5291 | }; | ||
5292 | static struct attribute_group qeth_drv_attr_group = { | ||
5293 | .attrs = qeth_drv_attrs, | ||
5294 | }; | ||
5295 | static const struct attribute_group *qeth_drv_attr_groups[] = { | ||
5296 | &qeth_drv_attr_group, | ||
5297 | NULL, | ||
5298 | }; | ||
5299 | |||
5310 | static struct { | 5300 | static struct { |
5311 | const char str[ETH_GSTRING_LEN]; | 5301 | const char str[ETH_GSTRING_LEN]; |
5312 | } qeth_ethtool_stats_keys[] = { | 5302 | } qeth_ethtool_stats_keys[] = { |
@@ -5544,49 +5534,41 @@ static int __init qeth_core_init(void) | |||
5544 | rc = qeth_register_dbf_views(); | 5534 | rc = qeth_register_dbf_views(); |
5545 | if (rc) | 5535 | if (rc) |
5546 | goto out_err; | 5536 | goto out_err; |
5547 | rc = ccw_driver_register(&qeth_ccw_driver); | ||
5548 | if (rc) | ||
5549 | goto ccw_err; | ||
5550 | rc = ccwgroup_driver_register(&qeth_core_ccwgroup_driver); | ||
5551 | if (rc) | ||
5552 | goto ccwgroup_err; | ||
5553 | rc = driver_create_file(&qeth_core_ccwgroup_driver.driver, | ||
5554 | &driver_attr_group); | ||
5555 | if (rc) | ||
5556 | goto driver_err; | ||
5557 | qeth_core_root_dev = root_device_register("qeth"); | 5537 | qeth_core_root_dev = root_device_register("qeth"); |
5558 | rc = IS_ERR(qeth_core_root_dev) ? PTR_ERR(qeth_core_root_dev) : 0; | 5538 | rc = IS_ERR(qeth_core_root_dev) ? PTR_ERR(qeth_core_root_dev) : 0; |
5559 | if (rc) | 5539 | if (rc) |
5560 | goto register_err; | 5540 | goto register_err; |
5561 | |||
5562 | qeth_core_header_cache = kmem_cache_create("qeth_hdr", | 5541 | qeth_core_header_cache = kmem_cache_create("qeth_hdr", |
5563 | sizeof(struct qeth_hdr) + ETH_HLEN, 64, 0, NULL); | 5542 | sizeof(struct qeth_hdr) + ETH_HLEN, 64, 0, NULL); |
5564 | if (!qeth_core_header_cache) { | 5543 | if (!qeth_core_header_cache) { |
5565 | rc = -ENOMEM; | 5544 | rc = -ENOMEM; |
5566 | goto slab_err; | 5545 | goto slab_err; |
5567 | } | 5546 | } |
5568 | |||
5569 | qeth_qdio_outbuf_cache = kmem_cache_create("qeth_buf", | 5547 | qeth_qdio_outbuf_cache = kmem_cache_create("qeth_buf", |
5570 | sizeof(struct qeth_qdio_out_buffer), 0, 0, NULL); | 5548 | sizeof(struct qeth_qdio_out_buffer), 0, 0, NULL); |
5571 | if (!qeth_qdio_outbuf_cache) { | 5549 | if (!qeth_qdio_outbuf_cache) { |
5572 | rc = -ENOMEM; | 5550 | rc = -ENOMEM; |
5573 | goto cqslab_err; | 5551 | goto cqslab_err; |
5574 | } | 5552 | } |
5553 | rc = ccw_driver_register(&qeth_ccw_driver); | ||
5554 | if (rc) | ||
5555 | goto ccw_err; | ||
5556 | qeth_core_ccwgroup_driver.driver.groups = qeth_drv_attr_groups; | ||
5557 | rc = ccwgroup_driver_register(&qeth_core_ccwgroup_driver); | ||
5558 | if (rc) | ||
5559 | goto ccwgroup_err; | ||
5575 | 5560 | ||
5576 | return 0; | 5561 | return 0; |
5562 | |||
5563 | ccwgroup_err: | ||
5564 | ccw_driver_unregister(&qeth_ccw_driver); | ||
5565 | ccw_err: | ||
5566 | kmem_cache_destroy(qeth_qdio_outbuf_cache); | ||
5577 | cqslab_err: | 5567 | cqslab_err: |
5578 | kmem_cache_destroy(qeth_core_header_cache); | 5568 | kmem_cache_destroy(qeth_core_header_cache); |
5579 | slab_err: | 5569 | slab_err: |
5580 | root_device_unregister(qeth_core_root_dev); | 5570 | root_device_unregister(qeth_core_root_dev); |
5581 | register_err: | 5571 | register_err: |
5582 | driver_remove_file(&qeth_core_ccwgroup_driver.driver, | ||
5583 | &driver_attr_group); | ||
5584 | driver_err: | ||
5585 | ccwgroup_driver_unregister(&qeth_core_ccwgroup_driver); | ||
5586 | ccwgroup_err: | ||
5587 | ccw_driver_unregister(&qeth_ccw_driver); | ||
5588 | ccw_err: | ||
5589 | QETH_DBF_MESSAGE(2, "Initialization failed with code %d\n", rc); | ||
5590 | qeth_unregister_dbf_views(); | 5572 | qeth_unregister_dbf_views(); |
5591 | out_err: | 5573 | out_err: |
5592 | pr_err("Initializing the qeth device driver failed\n"); | 5574 | pr_err("Initializing the qeth device driver failed\n"); |
@@ -5595,13 +5577,11 @@ out_err: | |||
5595 | 5577 | ||
5596 | static void __exit qeth_core_exit(void) | 5578 | static void __exit qeth_core_exit(void) |
5597 | { | 5579 | { |
5598 | root_device_unregister(qeth_core_root_dev); | ||
5599 | driver_remove_file(&qeth_core_ccwgroup_driver.driver, | ||
5600 | &driver_attr_group); | ||
5601 | ccwgroup_driver_unregister(&qeth_core_ccwgroup_driver); | 5580 | ccwgroup_driver_unregister(&qeth_core_ccwgroup_driver); |
5602 | ccw_driver_unregister(&qeth_ccw_driver); | 5581 | ccw_driver_unregister(&qeth_ccw_driver); |
5603 | kmem_cache_destroy(qeth_qdio_outbuf_cache); | 5582 | kmem_cache_destroy(qeth_qdio_outbuf_cache); |
5604 | kmem_cache_destroy(qeth_core_header_cache); | 5583 | kmem_cache_destroy(qeth_core_header_cache); |
5584 | root_device_unregister(qeth_core_root_dev); | ||
5605 | qeth_unregister_dbf_views(); | 5585 | qeth_unregister_dbf_views(); |
5606 | pr_info("core functions removed\n"); | 5586 | pr_info("core functions removed\n"); |
5607 | } | 5587 | } |
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c index 0a8e86c1b0ea..f163af575c48 100644 --- a/drivers/s390/net/qeth_core_sys.c +++ b/drivers/s390/net/qeth_core_sys.c | |||
@@ -434,8 +434,8 @@ static ssize_t qeth_dev_layer2_store(struct device *dev, | |||
434 | goto out; | 434 | goto out; |
435 | else { | 435 | else { |
436 | card->info.mac_bits = 0; | 436 | card->info.mac_bits = 0; |
437 | if (card->discipline.ccwgdriver) { | 437 | if (card->discipline) { |
438 | card->discipline.ccwgdriver->remove(card->gdev); | 438 | card->discipline->remove(card->gdev); |
439 | qeth_core_free_discipline(card); | 439 | qeth_core_free_discipline(card); |
440 | } | 440 | } |
441 | } | 441 | } |
@@ -444,7 +444,7 @@ static ssize_t qeth_dev_layer2_store(struct device *dev, | |||
444 | if (rc) | 444 | if (rc) |
445 | goto out; | 445 | goto out; |
446 | 446 | ||
447 | rc = card->discipline.ccwgdriver->probe(card->gdev); | 447 | rc = card->discipline->setup(card->gdev); |
448 | out: | 448 | out: |
449 | mutex_unlock(&card->discipline_mutex); | 449 | mutex_unlock(&card->discipline_mutex); |
450 | return rc ? rc : count; | 450 | return rc ? rc : count; |
@@ -693,7 +693,6 @@ static struct attribute *qeth_blkt_device_attrs[] = { | |||
693 | &dev_attr_inter_jumbo.attr, | 693 | &dev_attr_inter_jumbo.attr, |
694 | NULL, | 694 | NULL, |
695 | }; | 695 | }; |
696 | |||
697 | static struct attribute_group qeth_device_blkt_group = { | 696 | static struct attribute_group qeth_device_blkt_group = { |
698 | .name = "blkt", | 697 | .name = "blkt", |
699 | .attrs = qeth_blkt_device_attrs, | 698 | .attrs = qeth_blkt_device_attrs, |
@@ -716,11 +715,16 @@ static struct attribute *qeth_device_attrs[] = { | |||
716 | &dev_attr_hw_trap.attr, | 715 | &dev_attr_hw_trap.attr, |
717 | NULL, | 716 | NULL, |
718 | }; | 717 | }; |
719 | |||
720 | static struct attribute_group qeth_device_attr_group = { | 718 | static struct attribute_group qeth_device_attr_group = { |
721 | .attrs = qeth_device_attrs, | 719 | .attrs = qeth_device_attrs, |
722 | }; | 720 | }; |
723 | 721 | ||
722 | const struct attribute_group *qeth_generic_attr_groups[] = { | ||
723 | &qeth_device_attr_group, | ||
724 | &qeth_device_blkt_group, | ||
725 | NULL, | ||
726 | }; | ||
727 | |||
724 | static struct attribute *qeth_osn_device_attrs[] = { | 728 | static struct attribute *qeth_osn_device_attrs[] = { |
725 | &dev_attr_state.attr, | 729 | &dev_attr_state.attr, |
726 | &dev_attr_chpid.attr, | 730 | &dev_attr_chpid.attr, |
@@ -730,37 +734,10 @@ static struct attribute *qeth_osn_device_attrs[] = { | |||
730 | &dev_attr_recover.attr, | 734 | &dev_attr_recover.attr, |
731 | NULL, | 735 | NULL, |
732 | }; | 736 | }; |
733 | |||
734 | static struct attribute_group qeth_osn_device_attr_group = { | 737 | static struct attribute_group qeth_osn_device_attr_group = { |
735 | .attrs = qeth_osn_device_attrs, | 738 | .attrs = qeth_osn_device_attrs, |
736 | }; | 739 | }; |
737 | 740 | const struct attribute_group *qeth_osn_attr_groups[] = { | |
738 | int qeth_core_create_device_attributes(struct device *dev) | 741 | &qeth_osn_device_attr_group, |
739 | { | 742 | NULL, |
740 | int ret; | 743 | }; |
741 | ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group); | ||
742 | if (ret) | ||
743 | return ret; | ||
744 | ret = sysfs_create_group(&dev->kobj, &qeth_device_blkt_group); | ||
745 | if (ret) | ||
746 | sysfs_remove_group(&dev->kobj, &qeth_device_attr_group); | ||
747 | |||
748 | return 0; | ||
749 | } | ||
750 | |||
751 | void qeth_core_remove_device_attributes(struct device *dev) | ||
752 | { | ||
753 | sysfs_remove_group(&dev->kobj, &qeth_device_attr_group); | ||
754 | sysfs_remove_group(&dev->kobj, &qeth_device_blkt_group); | ||
755 | } | ||
756 | |||
757 | int qeth_core_create_osn_attributes(struct device *dev) | ||
758 | { | ||
759 | return sysfs_create_group(&dev->kobj, &qeth_osn_device_attr_group); | ||
760 | } | ||
761 | |||
762 | void qeth_core_remove_osn_attributes(struct device *dev) | ||
763 | { | ||
764 | sysfs_remove_group(&dev->kobj, &qeth_osn_device_attr_group); | ||
765 | return; | ||
766 | } | ||
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 0e7c29d1d7ef..426986518e96 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -882,12 +882,6 @@ static int qeth_l2_probe_device(struct ccwgroup_device *gdev) | |||
882 | INIT_LIST_HEAD(&card->mc_list); | 882 | INIT_LIST_HEAD(&card->mc_list); |
883 | card->options.layer2 = 1; | 883 | card->options.layer2 = 1; |
884 | card->info.hwtrap = 0; | 884 | card->info.hwtrap = 0; |
885 | card->discipline.start_poll = qeth_qdio_start_poll; | ||
886 | card->discipline.input_handler = (qdio_handler_t *) | ||
887 | qeth_qdio_input_handler; | ||
888 | card->discipline.output_handler = (qdio_handler_t *) | ||
889 | qeth_qdio_output_handler; | ||
890 | card->discipline.recover = qeth_l2_recover; | ||
891 | return 0; | 885 | return 0; |
892 | } | 886 | } |
893 | 887 | ||
@@ -1227,8 +1221,12 @@ out: | |||
1227 | return rc; | 1221 | return rc; |
1228 | } | 1222 | } |
1229 | 1223 | ||
1230 | struct ccwgroup_driver qeth_l2_ccwgroup_driver = { | 1224 | struct qeth_discipline qeth_l2_discipline = { |
1231 | .probe = qeth_l2_probe_device, | 1225 | .start_poll = qeth_qdio_start_poll, |
1226 | .input_handler = (qdio_handler_t *) qeth_qdio_input_handler, | ||
1227 | .output_handler = (qdio_handler_t *) qeth_qdio_output_handler, | ||
1228 | .recover = qeth_l2_recover, | ||
1229 | .setup = qeth_l2_probe_device, | ||
1232 | .remove = qeth_l2_remove_device, | 1230 | .remove = qeth_l2_remove_device, |
1233 | .set_online = qeth_l2_set_online, | 1231 | .set_online = qeth_l2_set_online, |
1234 | .set_offline = qeth_l2_set_offline, | 1232 | .set_offline = qeth_l2_set_offline, |
@@ -1237,7 +1235,7 @@ struct ccwgroup_driver qeth_l2_ccwgroup_driver = { | |||
1237 | .thaw = qeth_l2_pm_resume, | 1235 | .thaw = qeth_l2_pm_resume, |
1238 | .restore = qeth_l2_pm_resume, | 1236 | .restore = qeth_l2_pm_resume, |
1239 | }; | 1237 | }; |
1240 | EXPORT_SYMBOL_GPL(qeth_l2_ccwgroup_driver); | 1238 | EXPORT_SYMBOL_GPL(qeth_l2_discipline); |
1241 | 1239 | ||
1242 | static int qeth_osn_send_control_data(struct qeth_card *card, int len, | 1240 | static int qeth_osn_send_control_data(struct qeth_card *card, int len, |
1243 | struct qeth_cmd_buffer *iob) | 1241 | struct qeth_cmd_buffer *iob) |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index e7ad03209cb2..7be5e9775691 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -3298,12 +3298,6 @@ static int qeth_l3_probe_device(struct ccwgroup_device *gdev) | |||
3298 | qeth_l3_create_device_attributes(&gdev->dev); | 3298 | qeth_l3_create_device_attributes(&gdev->dev); |
3299 | card->options.layer2 = 0; | 3299 | card->options.layer2 = 0; |
3300 | card->info.hwtrap = 0; | 3300 | card->info.hwtrap = 0; |
3301 | card->discipline.start_poll = qeth_qdio_start_poll; | ||
3302 | card->discipline.input_handler = (qdio_handler_t *) | ||
3303 | qeth_qdio_input_handler; | ||
3304 | card->discipline.output_handler = (qdio_handler_t *) | ||
3305 | qeth_qdio_output_handler; | ||
3306 | card->discipline.recover = qeth_l3_recover; | ||
3307 | return 0; | 3301 | return 0; |
3308 | } | 3302 | } |
3309 | 3303 | ||
@@ -3578,8 +3572,12 @@ out: | |||
3578 | return rc; | 3572 | return rc; |
3579 | } | 3573 | } |
3580 | 3574 | ||
3581 | struct ccwgroup_driver qeth_l3_ccwgroup_driver = { | 3575 | struct qeth_discipline qeth_l3_discipline = { |
3582 | .probe = qeth_l3_probe_device, | 3576 | .start_poll = qeth_qdio_start_poll, |
3577 | .input_handler = (qdio_handler_t *) qeth_qdio_input_handler, | ||
3578 | .output_handler = (qdio_handler_t *) qeth_qdio_output_handler, | ||
3579 | .recover = qeth_l3_recover, | ||
3580 | .setup = qeth_l3_probe_device, | ||
3583 | .remove = qeth_l3_remove_device, | 3581 | .remove = qeth_l3_remove_device, |
3584 | .set_online = qeth_l3_set_online, | 3582 | .set_online = qeth_l3_set_online, |
3585 | .set_offline = qeth_l3_set_offline, | 3583 | .set_offline = qeth_l3_set_offline, |
@@ -3588,7 +3586,7 @@ struct ccwgroup_driver qeth_l3_ccwgroup_driver = { | |||
3588 | .thaw = qeth_l3_pm_resume, | 3586 | .thaw = qeth_l3_pm_resume, |
3589 | .restore = qeth_l3_pm_resume, | 3587 | .restore = qeth_l3_pm_resume, |
3590 | }; | 3588 | }; |
3591 | EXPORT_SYMBOL_GPL(qeth_l3_ccwgroup_driver); | 3589 | EXPORT_SYMBOL_GPL(qeth_l3_discipline); |
3592 | 3590 | ||
3593 | static int qeth_l3_ip_event(struct notifier_block *this, | 3591 | static int qeth_l3_ip_event(struct notifier_block *this, |
3594 | unsigned long event, void *ptr) | 3592 | unsigned long event, void *ptr) |