aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net')
-rw-r--r--drivers/s390/net/Kconfig5
-rw-r--r--drivers/s390/net/claw.c165
-rw-r--r--drivers/s390/net/ctcm_main.c52
-rw-r--r--drivers/s390/net/ctcm_main.h8
-rw-r--r--drivers/s390/net/ctcm_sysfs.c37
-rw-r--r--drivers/s390/net/lcs.c73
-rw-r--r--drivers/s390/net/qeth_core.h28
-rw-r--r--drivers/s390/net/qeth_core_main.c192
-rw-r--r--drivers/s390/net/qeth_core_mpc.h10
-rw-r--r--drivers/s390/net/qeth_core_sys.c49
-rw-r--r--drivers/s390/net/qeth_l2_main.c16
-rw-r--r--drivers/s390/net/qeth_l3_main.c110
-rw-r--r--drivers/s390/net/qeth_l3_sys.c112
13 files changed, 252 insertions, 605 deletions
diff --git a/drivers/s390/net/Kconfig b/drivers/s390/net/Kconfig
index 9b66d2d1809b..dfda748c4000 100644
--- a/drivers/s390/net/Kconfig
+++ b/drivers/s390/net/Kconfig
@@ -4,11 +4,10 @@ menu "S/390 network device drivers"
4config LCS 4config LCS
5 def_tristate m 5 def_tristate m
6 prompt "Lan Channel Station Interface" 6 prompt "Lan Channel Station Interface"
7 depends on CCW && NETDEVICES && (ETHERNET || TR || FDDI) 7 depends on CCW && NETDEVICES && (ETHERNET || FDDI)
8 help 8 help
9 Select this option if you want to use LCS networking on IBM System z. 9 Select this option if you want to use LCS networking on IBM System z.
10 This device driver supports Token Ring (IEEE 802.5), 10 This device driver supports FDDI (IEEE 802.7) and Ethernet.
11 FDDI (IEEE 802.7) and Ethernet.
12 To compile as a module, choose M. The module name is lcs. 11 To compile as a module, choose M. The module name is lcs.
13 If you do not know what it is, it's safe to choose Y. 12 If you do not know what it is, it's safe to choose Y.
14 13
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
136claw_set_busy(struct net_device *dev) 136claw_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
142static inline void 141static 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
150static inline int 148static inline int
151claw_check_busy(struct net_device *dev) 149claw_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,
233static ssize_t claw_rbuff_write(struct device *dev, 230static 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);
236static int claw_add_files(struct device *dev);
237static void claw_remove_files(struct device *dev);
238 233
239/* Functions for System Validate */ 234/* Functions for System Validate */
240static int claw_process_control( struct net_device *dev, struct ccwbk * p_ccw); 235static 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
296static ssize_t 289static ssize_t claw_driver_group_store(struct device_driver *ddrv,
297claw_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
307static DRIVER_ATTR(group, 0200, NULL, claw_driver_group_store); 296static DRIVER_ATTR(group, 0200, NULL, claw_driver_group_store);
308 297
309static struct attribute *claw_group_attrs[] = { 298static struct attribute *claw_drv_attrs[] = {
310 &driver_attr_group.attr, 299 &driver_attr_group.attr,
311 NULL, 300 NULL,
312}; 301};
313 302static struct attribute_group claw_drv_attr_group = {
314static struct attribute_group claw_group_attr_group = { 303 .attrs = claw_drv_attrs,
315 .attrs = claw_group_attrs,
316}; 304};
317 305static const struct attribute_group *claw_drv_attr_groups[] = {
318static 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 *----------------------------------------------------------------*/
331static int
332claw_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
3325static DEVICE_ATTR(read_buffer, 0644, claw_rbuff_show, claw_rbuff_write); 3256static DEVICE_ATTR(read_buffer, 0644, claw_rbuff_show, claw_rbuff_write);
3326 3257
3327static struct attribute *claw_attr[] = { 3258static 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
3336static struct attribute_group claw_attr_group = { 3266static struct attribute_group claw_attr_group = {
3337 .attrs = claw_attr, 3267 .attrs = claw_attr,
3338}; 3268};
3269static const struct attribute_group *claw_attr_groups[] = {
3270 &claw_attr_group,
3271 NULL,
3272};
3273static const struct device_type claw_devtype = {
3274 .name = "claw",
3275 .groups = claw_attr_groups,
3276};
3339 3277
3340static int 3278/*----------------------------------------------------------------*
3341claw_add_files(struct device *dev) 3279 * claw_probe *
3280 * this function is called for each CLAW device. *
3281 *----------------------------------------------------------------*/
3282static 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
3347static void 3286 CLAW_DBF_TEXT(2, setup, "probe");
3348claw_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
3358static void __exit 3326static void __exit claw_cleanup(void)
3359claw_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 */
3377static int __init 3341static int __init claw_init(void)
3378claw_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
1299static 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,
1307static int ctcm_probe_device(struct ccwgroup_device *cgdev) 1312static 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;
1632out_unregister:
1633 unregister_netdev(dev);
1634out_dev: 1625out_dev:
1635 ctcm_free_netdevice(dev); 1626 ctcm_free_netdevice(dev);
1636out_ccw2: 1627out_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
1792static ssize_t 1779static ssize_t ctcm_driver_group_store(struct device_driver *ddrv,
1793ctcm_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
1804static DRIVER_ATTR(group, 0200, NULL, ctcm_driver_group_store); 1787static DRIVER_ATTR(group, 0200, NULL, ctcm_driver_group_store);
1805 1788
1806static struct attribute *ctcm_group_attrs[] = { 1789static struct attribute *ctcm_drv_attrs[] = {
1807 &driver_attr_group.attr, 1790 &driver_attr_group.attr,
1808 NULL, 1791 NULL,
1809}; 1792};
1810 1793static struct attribute_group ctcm_drv_attr_group = {
1811static struct attribute_group ctcm_group_attr_group = { 1794 .attrs = ctcm_drv_attrs,
1812 .attrs = ctcm_group_attrs,
1813}; 1795};
1814 1796static const struct attribute_group *ctcm_drv_attr_groups[] = {
1815static 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 */
1830static void __exit ctcm_exit(void) 1811static 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 {
225int ctcm_open(struct net_device *dev); 225int ctcm_open(struct net_device *dev);
226int ctcm_close(struct net_device *dev); 226int ctcm_close(struct net_device *dev);
227 227
228/* 228extern const struct attribute_group *ctcm_attr_groups[];
229 * prototypes for non-static sysfs functions
230 */
231int ctcm_add_attributes(struct device *dev);
232void ctcm_remove_attributes(struct device *dev);
233int ctcm_add_files(struct device *dev);
234void 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
110static ssize_t stats_show(struct device *dev, 111static 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
196static struct attribute_group ctcm_attr_group = { 200static struct attribute_group ctcm_attr_group = {
197 .attrs = ctcm_attr, 201 .attrs = ctcm_attr,
198}; 202};
199 203const struct attribute_group *ctcm_attr_groups[] = {
200int 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
209void ctcm_remove_attributes(struct device *dev)
210{
211 device_remove_file(dev, &dev_attr_stats);
212}
213
214int ctcm_add_files(struct device *dev)
215{
216 return sysfs_create_group(&dev->kobj, &ctcm_attr_group);
217}
218
219void 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 687efe4d589a..a3adf4b1c60d 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -30,7 +30,6 @@
30#include <linux/if.h> 30#include <linux/if.h>
31#include <linux/netdevice.h> 31#include <linux/netdevice.h>
32#include <linux/etherdevice.h> 32#include <linux/etherdevice.h>
33#include <linux/trdevice.h>
34#include <linux/fddidevice.h> 33#include <linux/fddidevice.h>
35#include <linux/inetdevice.h> 34#include <linux/inetdevice.h>
36#include <linux/in.h> 35#include <linux/in.h>
@@ -50,8 +49,7 @@
50#include "lcs.h" 49#include "lcs.h"
51 50
52 51
53#if !defined(CONFIG_ETHERNET) && \ 52#if !defined(CONFIG_ETHERNET) && !defined(CONFIG_FDDI)
54 !defined(CONFIG_TR) && !defined(CONFIG_FDDI)
55#error Cannot compile lcs.c without some net devices switched on. 53#error Cannot compile lcs.c without some net devices switched on.
56#endif 54#endif
57 55
@@ -1166,10 +1164,7 @@ static void
1166lcs_get_mac_for_ipm(__be32 ipm, char *mac, struct net_device *dev) 1164lcs_get_mac_for_ipm(__be32 ipm, char *mac, struct net_device *dev)
1167{ 1165{
1168 LCS_DBF_TEXT(4,trace, "getmac"); 1166 LCS_DBF_TEXT(4,trace, "getmac");
1169 if (dev->type == ARPHRD_IEEE802_TR) 1167 ip_eth_mc_map(ipm, mac);
1170 ip_tr_mc_map(ipm, mac);
1171 else
1172 ip_eth_mc_map(ipm, mac);
1173} 1168}
1174 1169
1175/** 1170/**
@@ -1641,12 +1636,6 @@ lcs_startlan_auto(struct lcs_card *card)
1641 return 0; 1636 return 0;
1642 1637
1643#endif 1638#endif
1644#ifdef CONFIG_TR
1645 card->lan_type = LCS_FRAME_TYPE_TR;
1646 rc = lcs_send_startlan(card, LCS_INITIATOR_TCPIP);
1647 if (rc == 0)
1648 return 0;
1649#endif
1650#ifdef CONFIG_FDDI 1639#ifdef CONFIG_FDDI
1651 card->lan_type = LCS_FRAME_TYPE_FDDI; 1640 card->lan_type = LCS_FRAME_TYPE_FDDI;
1652 rc = lcs_send_startlan(card, LCS_INITIATOR_TCPIP); 1641 rc = lcs_send_startlan(card, LCS_INITIATOR_TCPIP);
@@ -2051,10 +2040,17 @@ static struct attribute * lcs_attrs[] = {
2051 &dev_attr_recover.attr, 2040 &dev_attr_recover.attr,
2052 NULL, 2041 NULL,
2053}; 2042};
2054
2055static struct attribute_group lcs_attr_group = { 2043static struct attribute_group lcs_attr_group = {
2056 .attrs = lcs_attrs, 2044 .attrs = lcs_attrs,
2057}; 2045};
2046static const struct attribute_group *lcs_attr_groups[] = {
2047 &lcs_attr_group,
2048 NULL,
2049};
2050static const struct device_type lcs_devtype = {
2051 .name = "lcs",
2052 .groups = lcs_attr_groups,
2053};
2058 2054
2059/** 2055/**
2060 * lcs_probe_device is called on establishing a new ccwgroup_device. 2056 * lcs_probe_device is called on establishing a new ccwgroup_device.
@@ -2063,7 +2059,6 @@ static int
2063lcs_probe_device(struct ccwgroup_device *ccwgdev) 2059lcs_probe_device(struct ccwgroup_device *ccwgdev)
2064{ 2060{
2065 struct lcs_card *card; 2061 struct lcs_card *card;
2066 int ret;
2067 2062
2068 if (!get_device(&ccwgdev->dev)) 2063 if (!get_device(&ccwgdev->dev))
2069 return -ENODEV; 2064 return -ENODEV;
@@ -2075,12 +2070,6 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev)
2075 put_device(&ccwgdev->dev); 2070 put_device(&ccwgdev->dev);
2076 return -ENOMEM; 2071 return -ENOMEM;
2077 } 2072 }
2078 ret = sysfs_create_group(&ccwgdev->dev.kobj, &lcs_attr_group);
2079 if (ret) {
2080 lcs_free_card(card);
2081 put_device(&ccwgdev->dev);
2082 return ret;
2083 }
2084 dev_set_drvdata(&ccwgdev->dev, card); 2073 dev_set_drvdata(&ccwgdev->dev, card);
2085 ccwgdev->cdev[0]->handler = lcs_irq; 2074 ccwgdev->cdev[0]->handler = lcs_irq;
2086 ccwgdev->cdev[1]->handler = lcs_irq; 2075 ccwgdev->cdev[1]->handler = lcs_irq;
@@ -2089,7 +2078,9 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev)
2089 card->thread_start_mask = 0; 2078 card->thread_start_mask = 0;
2090 card->thread_allowed_mask = 0; 2079 card->thread_allowed_mask = 0;
2091 card->thread_running_mask = 0; 2080 card->thread_running_mask = 0;
2092 return 0; 2081 ccwgdev->dev.type = &lcs_devtype;
2082
2083 return 0;
2093} 2084}
2094 2085
2095static int 2086static int
@@ -2172,12 +2163,6 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
2172 dev = alloc_etherdev(0); 2163 dev = alloc_etherdev(0);
2173 break; 2164 break;
2174#endif 2165#endif
2175#ifdef CONFIG_TR
2176 case LCS_FRAME_TYPE_TR:
2177 card->lan_type_trans = tr_type_trans;
2178 dev = alloc_trdev(0);
2179 break;
2180#endif
2181#ifdef CONFIG_FDDI 2166#ifdef CONFIG_FDDI
2182 case LCS_FRAME_TYPE_FDDI: 2167 case LCS_FRAME_TYPE_FDDI:
2183 card->lan_type_trans = fddi_type_trans; 2168 card->lan_type_trans = fddi_type_trans;
@@ -2323,9 +2308,9 @@ lcs_remove_device(struct ccwgroup_device *ccwgdev)
2323 } 2308 }
2324 if (card->dev) 2309 if (card->dev)
2325 unregister_netdev(card->dev); 2310 unregister_netdev(card->dev);
2326 sysfs_remove_group(&ccwgdev->dev.kobj, &lcs_attr_group);
2327 lcs_cleanup_card(card); 2311 lcs_cleanup_card(card);
2328 lcs_free_card(card); 2312 lcs_free_card(card);
2313 dev_set_drvdata(&ccwgdev->dev, NULL);
2329 put_device(&ccwgdev->dev); 2314 put_device(&ccwgdev->dev);
2330} 2315}
2331 2316
@@ -2410,9 +2395,7 @@ static struct ccwgroup_driver lcs_group_driver = {
2410 .owner = THIS_MODULE, 2395 .owner = THIS_MODULE,
2411 .name = "lcs", 2396 .name = "lcs",
2412 }, 2397 },
2413 .max_slaves = 2, 2398 .setup = lcs_probe_device,
2414 .driver_id = 0xD3C3E2,
2415 .probe = lcs_probe_device,
2416 .remove = lcs_remove_device, 2399 .remove = lcs_remove_device,
2417 .set_online = lcs_new_device, 2400 .set_online = lcs_new_device,
2418 .set_offline = lcs_shutdown_device, 2401 .set_offline = lcs_shutdown_device,
@@ -2423,30 +2406,24 @@ static struct ccwgroup_driver lcs_group_driver = {
2423 .restore = lcs_restore, 2406 .restore = lcs_restore,
2424}; 2407};
2425 2408
2426static ssize_t 2409static ssize_t lcs_driver_group_store(struct device_driver *ddrv,
2427lcs_driver_group_store(struct device_driver *ddrv, const char *buf, 2410 const char *buf, size_t count)
2428 size_t count)
2429{ 2411{
2430 int err; 2412 int err;
2431 err = ccwgroup_create_from_string(lcs_root_dev, 2413 err = ccwgroup_create_dev(lcs_root_dev, &lcs_group_driver, 2, buf);
2432 lcs_group_driver.driver_id,
2433 &lcs_ccw_driver, 2, buf);
2434 return err ? err : count; 2414 return err ? err : count;
2435} 2415}
2436
2437static DRIVER_ATTR(group, 0200, NULL, lcs_driver_group_store); 2416static DRIVER_ATTR(group, 0200, NULL, lcs_driver_group_store);
2438 2417
2439static struct attribute *lcs_group_attrs[] = { 2418static struct attribute *lcs_drv_attrs[] = {
2440 &driver_attr_group.attr, 2419 &driver_attr_group.attr,
2441 NULL, 2420 NULL,
2442}; 2421};
2443 2422static struct attribute_group lcs_drv_attr_group = {
2444static struct attribute_group lcs_group_attr_group = { 2423 .attrs = lcs_drv_attrs,
2445 .attrs = lcs_group_attrs,
2446}; 2424};
2447 2425static const struct attribute_group *lcs_drv_attr_groups[] = {
2448static const struct attribute_group *lcs_group_attr_groups[] = { 2426 &lcs_drv_attr_group,
2449 &lcs_group_attr_group,
2450 NULL, 2427 NULL,
2451}; 2428};
2452 2429
@@ -2470,7 +2447,7 @@ __init lcs_init_module(void)
2470 rc = ccw_driver_register(&lcs_ccw_driver); 2447 rc = ccw_driver_register(&lcs_ccw_driver);
2471 if (rc) 2448 if (rc)
2472 goto ccw_err; 2449 goto ccw_err;
2473 lcs_group_driver.driver.groups = lcs_group_attr_groups; 2450 lcs_group_driver.driver.groups = lcs_drv_attr_groups;
2474 rc = ccwgroup_driver_register(&lcs_group_driver); 2451 rc = ccwgroup_driver_register(&lcs_group_driver);
2475 if (rc) 2452 if (rc)
2476 goto ccwgroup_err; 2453 goto ccwgroup_err;
@@ -2496,8 +2473,6 @@ __exit lcs_cleanup_module(void)
2496{ 2473{
2497 pr_info("Terminating lcs module.\n"); 2474 pr_info("Terminating lcs module.\n");
2498 LCS_DBF_TEXT(0, trace, "cleanup"); 2475 LCS_DBF_TEXT(0, trace, "cleanup");
2499 driver_remove_file(&lcs_group_driver.driver,
2500 &driver_attr_group);
2501 ccwgroup_driver_unregister(&lcs_group_driver); 2476 ccwgroup_driver_unregister(&lcs_group_driver);
2502 ccw_driver_unregister(&lcs_ccw_driver); 2477 ccw_driver_unregister(&lcs_ccw_driver);
2503 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 ec7921b5138e..06e8f31ff3dc 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -13,8 +13,6 @@
13 13
14#include <linux/if.h> 14#include <linux/if.h>
15#include <linux/if_arp.h> 15#include <linux/if_arp.h>
16#include <linux/if_tr.h>
17#include <linux/trdevice.h>
18#include <linux/etherdevice.h> 16#include <linux/etherdevice.h>
19#include <linux/if_vlan.h> 17#include <linux/if_vlan.h>
20#include <linux/ctype.h> 18#include <linux/ctype.h>
@@ -676,8 +674,6 @@ struct qeth_card_options {
676 struct qeth_ipa_info adp; /*Adapter parameters*/ 674 struct qeth_ipa_info adp; /*Adapter parameters*/
677 struct qeth_routing_info route6; 675 struct qeth_routing_info route6;
678 struct qeth_ipa_info ipa6; 676 struct qeth_ipa_info ipa6;
679 int broadcast_mode;
680 int macaddr_mode;
681 int fake_broadcast; 677 int fake_broadcast;
682 int add_hhlen; 678 int add_hhlen;
683 int layer2; 679 int layer2;
@@ -711,7 +707,16 @@ struct qeth_discipline {
711 qdio_handler_t *input_handler; 707 qdio_handler_t *input_handler;
712 qdio_handler_t *output_handler; 708 qdio_handler_t *output_handler;
713 int (*recover)(void *ptr); 709 int (*recover)(void *ptr);
714 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 *);
715}; 720};
716 721
717struct qeth_vlan_vid { 722struct qeth_vlan_vid {
@@ -775,7 +780,7 @@ struct qeth_card {
775 struct qeth_perf_stats perf_stats; 780 struct qeth_perf_stats perf_stats;
776 int read_or_write_problem; 781 int read_or_write_problem;
777 struct qeth_osn_info osn_info; 782 struct qeth_osn_info osn_info;
778 struct qeth_discipline discipline; 783 struct qeth_discipline *discipline;
779 atomic_t force_alloc_skb; 784 atomic_t force_alloc_skb;
780 struct service_level qeth_service_level; 785 struct service_level qeth_service_level;
781 struct qdio_ssqd_desc ssqd; 786 struct qdio_ssqd_desc ssqd;
@@ -841,16 +846,15 @@ static inline int qeth_is_diagass_supported(struct qeth_card *card,
841 return card->info.diagass_support & (__u32)cmd; 846 return card->info.diagass_support & (__u32)cmd;
842} 847}
843 848
844extern struct ccwgroup_driver qeth_l2_ccwgroup_driver; 849extern struct qeth_discipline qeth_l2_discipline;
845extern struct ccwgroup_driver qeth_l3_ccwgroup_driver; 850extern struct qeth_discipline qeth_l3_discipline;
851extern const struct attribute_group *qeth_generic_attr_groups[];
852extern const struct attribute_group *qeth_osn_attr_groups[];
853
846const char *qeth_get_cardname_short(struct qeth_card *); 854const char *qeth_get_cardname_short(struct qeth_card *);
847int qeth_realloc_buffer_pool(struct qeth_card *, int); 855int qeth_realloc_buffer_pool(struct qeth_card *, int);
848int qeth_core_load_discipline(struct qeth_card *, enum qeth_discipline_id); 856int qeth_core_load_discipline(struct qeth_card *, enum qeth_discipline_id);
849void qeth_core_free_discipline(struct qeth_card *); 857void qeth_core_free_discipline(struct qeth_card *);
850int qeth_core_create_device_attributes(struct device *);
851void qeth_core_remove_device_attributes(struct device *);
852int qeth_core_create_osn_attributes(struct device *);
853void qeth_core_remove_osn_attributes(struct device *);
854void qeth_buffer_reclaim_work(struct work_struct *); 858void qeth_buffer_reclaim_work(struct work_struct *);
855 859
856/* 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 120955c66410..e118e1e1e1c1 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1329,8 +1329,6 @@ static void qeth_set_intial_options(struct qeth_card *card)
1329{ 1329{
1330 card->options.route4.type = NO_ROUTER; 1330 card->options.route4.type = NO_ROUTER;
1331 card->options.route6.type = NO_ROUTER; 1331 card->options.route6.type = NO_ROUTER;
1332 card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS;
1333 card->options.macaddr_mode = QETH_TR_MACADDR_NONCANONICAL;
1334 card->options.fake_broadcast = 0; 1332 card->options.fake_broadcast = 0;
1335 card->options.add_hhlen = DEFAULT_ADD_HHLEN; 1333 card->options.add_hhlen = DEFAULT_ADD_HHLEN;
1336 card->options.performance_stats = 0; 1334 card->options.performance_stats = 0;
@@ -1365,7 +1363,7 @@ static void qeth_start_kernel_thread(struct work_struct *work)
1365 card->write.state != CH_STATE_UP) 1363 card->write.state != CH_STATE_UP)
1366 return; 1364 return;
1367 if (qeth_do_start_thread(card, QETH_RECOVER_THREAD)) { 1365 if (qeth_do_start_thread(card, QETH_RECOVER_THREAD)) {
1368 ts = kthread_run(card->discipline.recover, (void *)card, 1366 ts = kthread_run(card->discipline->recover, (void *)card,
1369 "qeth_recover"); 1367 "qeth_recover");
1370 if (IS_ERR(ts)) { 1368 if (IS_ERR(ts)) {
1371 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); 1369 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD);
@@ -1672,7 +1670,8 @@ static void qeth_configure_blkt_default(struct qeth_card *card, char *prcd)
1672{ 1670{
1673 QETH_DBF_TEXT(SETUP, 2, "cfgblkt"); 1671 QETH_DBF_TEXT(SETUP, 2, "cfgblkt");
1674 1672
1675 if (prcd[74] == 0xF0 && prcd[75] == 0xF0 && prcd[76] == 0xF5) { 1673 if (prcd[74] == 0xF0 && prcd[75] == 0xF0 &&
1674 (prcd[76] == 0xF5 || prcd[76] == 0xF6)) {
1676 card->info.blkt.time_total = 250; 1675 card->info.blkt.time_total = 250;
1677 card->info.blkt.inter_packet = 5; 1676 card->info.blkt.inter_packet = 5;
1678 card->info.blkt.inter_packet_jumbo = 15; 1677 card->info.blkt.inter_packet_jumbo = 15;
@@ -3338,7 +3337,7 @@ static void qeth_flush_buffers(struct qeth_qdio_out_q *queue, int index,
3338 if (rc) { 3337 if (rc) {
3339 queue->card->stats.tx_errors += count; 3338 queue->card->stats.tx_errors += count;
3340 /* ignore temporary SIGA errors without busy condition */ 3339 /* ignore temporary SIGA errors without busy condition */
3341 if (rc == QDIO_ERROR_SIGA_TARGET) 3340 if (rc == -ENOBUFS)
3342 return; 3341 return;
3343 QETH_CARD_TEXT(queue->card, 2, "flushbuf"); 3342 QETH_CARD_TEXT(queue->card, 2, "flushbuf");
3344 QETH_CARD_TEXT_(queue->card, 2, " q%d", queue->queue_no); 3343 QETH_CARD_TEXT_(queue->card, 2, " q%d", queue->queue_no);
@@ -3532,7 +3531,7 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
3532 int i; 3531 int i;
3533 3532
3534 QETH_CARD_TEXT(card, 6, "qdouhdl"); 3533 QETH_CARD_TEXT(card, 6, "qdouhdl");
3535 if (qdio_error & QDIO_ERROR_ACTIVATE_CHECK_CONDITION) { 3534 if (qdio_error & QDIO_ERROR_FATAL) {
3536 QETH_CARD_TEXT(card, 2, "achkcond"); 3535 QETH_CARD_TEXT(card, 2, "achkcond");
3537 netif_stop_queue(card->dev); 3536 netif_stop_queue(card->dev);
3538 qeth_schedule_recovery(card); 3537 qeth_schedule_recovery(card);
@@ -4540,7 +4539,8 @@ static void qeth_determine_capabilities(struct qeth_card *card)
4540 goto out_offline; 4539 goto out_offline;
4541 } 4540 }
4542 qeth_configure_unitaddr(card, prcd); 4541 qeth_configure_unitaddr(card, prcd);
4543 qeth_configure_blkt_default(card, prcd); 4542 if (ddev_offline)
4543 qeth_configure_blkt_default(card, prcd);
4544 kfree(prcd); 4544 kfree(prcd);
4545 4545
4546 rc = qdio_get_ssqd_desc(ddev, &card->ssqd); 4546 rc = qdio_get_ssqd_desc(ddev, &card->ssqd);
@@ -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
4740static 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
4747int qeth_core_hardsetup_card(struct qeth_card *card) 4740int qeth_core_hardsetup_card(struct qeth_card *card)
4748{ 4741{
4749 int retries = 0; 4742 int retries = 0;
@@ -4909,11 +4902,7 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
4909 break; 4902 break;
4910 case QETH_HEADER_TYPE_LAYER3: 4903 case QETH_HEADER_TYPE_LAYER3:
4911 skb_len = (*hdr)->hdr.l3.length; 4904 skb_len = (*hdr)->hdr.l3.length;
4912 if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) || 4905 headroom = ETH_HLEN;
4913 (card->info.link_type == QETH_LINK_TYPE_HSTR))
4914 headroom = TR_HLEN;
4915 else
4916 headroom = ETH_HLEN;
4917 break; 4906 break;
4918 case QETH_HEADER_TYPE_OSN: 4907 case QETH_HEADER_TYPE_OSN:
4919 skb_len = (*hdr)->hdr.osn.pdu_length; 4908 skb_len = (*hdr)->hdr.osn.pdu_length;
@@ -5044,17 +5033,15 @@ int qeth_core_load_discipline(struct qeth_card *card,
5044 mutex_lock(&qeth_mod_mutex); 5033 mutex_lock(&qeth_mod_mutex);
5045 switch (discipline) { 5034 switch (discipline) {
5046 case QETH_DISCIPLINE_LAYER3: 5035 case QETH_DISCIPLINE_LAYER3:
5047 card->discipline.ccwgdriver = try_then_request_module( 5036 card->discipline = try_then_request_module(
5048 symbol_get(qeth_l3_ccwgroup_driver), 5037 symbol_get(qeth_l3_discipline), "qeth_l3");
5049 "qeth_l3");
5050 break; 5038 break;
5051 case QETH_DISCIPLINE_LAYER2: 5039 case QETH_DISCIPLINE_LAYER2:
5052 card->discipline.ccwgdriver = try_then_request_module( 5040 card->discipline = try_then_request_module(
5053 symbol_get(qeth_l2_ccwgroup_driver), 5041 symbol_get(qeth_l2_discipline), "qeth_l2");
5054 "qeth_l2");
5055 break; 5042 break;
5056 } 5043 }
5057 if (!card->discipline.ccwgdriver) { 5044 if (!card->discipline) {
5058 dev_err(&card->gdev->dev, "There is no kernel module to " 5045 dev_err(&card->gdev->dev, "There is no kernel module to "
5059 "support discipline %d\n", discipline); 5046 "support discipline %d\n", discipline);
5060 rc = -EINVAL; 5047 rc = -EINVAL;
@@ -5066,12 +5053,21 @@ int qeth_core_load_discipline(struct qeth_card *card,
5066void qeth_core_free_discipline(struct qeth_card *card) 5053void qeth_core_free_discipline(struct qeth_card *card)
5067{ 5054{
5068 if (card->options.layer2) 5055 if (card->options.layer2)
5069 symbol_put(qeth_l2_ccwgroup_driver); 5056 symbol_put(qeth_l2_discipline);
5070 else 5057 else
5071 symbol_put(qeth_l3_ccwgroup_driver); 5058 symbol_put(qeth_l3_discipline);
5072 card->discipline.ccwgdriver = NULL; 5059 card->discipline = NULL;
5073} 5060}
5074 5061
5062static const struct device_type qeth_generic_devtype = {
5063 .name = "qeth_generic",
5064 .groups = qeth_generic_attr_groups,
5065};
5066static const struct device_type qeth_osn_devtype = {
5067 .name = "qeth_osn",
5068 .groups = qeth_osn_attr_groups,
5069};
5070
5075static int qeth_core_probe_device(struct ccwgroup_device *gdev) 5071static int qeth_core_probe_device(struct ccwgroup_device *gdev)
5076{ 5072{
5077 struct qeth_card *card; 5073 struct qeth_card *card;
@@ -5126,18 +5122,17 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
5126 } 5122 }
5127 5123
5128 if (card->info.type == QETH_CARD_TYPE_OSN) 5124 if (card->info.type == QETH_CARD_TYPE_OSN)
5129 rc = qeth_core_create_osn_attributes(dev); 5125 gdev->dev.type = &qeth_osn_devtype;
5130 else 5126 else
5131 rc = qeth_core_create_device_attributes(dev); 5127 gdev->dev.type = &qeth_generic_devtype;
5132 if (rc) 5128
5133 goto err_dbf;
5134 switch (card->info.type) { 5129 switch (card->info.type) {
5135 case QETH_CARD_TYPE_OSN: 5130 case QETH_CARD_TYPE_OSN:
5136 case QETH_CARD_TYPE_OSM: 5131 case QETH_CARD_TYPE_OSM:
5137 rc = qeth_core_load_discipline(card, QETH_DISCIPLINE_LAYER2); 5132 rc = qeth_core_load_discipline(card, QETH_DISCIPLINE_LAYER2);
5138 if (rc) 5133 if (rc)
5139 goto err_attr; 5134 goto err_dbf;
5140 rc = card->discipline.ccwgdriver->probe(card->gdev); 5135 rc = card->discipline->setup(card->gdev);
5141 if (rc) 5136 if (rc)
5142 goto err_disc; 5137 goto err_disc;
5143 case QETH_CARD_TYPE_OSD: 5138 case QETH_CARD_TYPE_OSD:
@@ -5155,11 +5150,6 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
5155 5150
5156err_disc: 5151err_disc:
5157 qeth_core_free_discipline(card); 5152 qeth_core_free_discipline(card);
5158err_attr:
5159 if (card->info.type == QETH_CARD_TYPE_OSN)
5160 qeth_core_remove_osn_attributes(dev);
5161 else
5162 qeth_core_remove_device_attributes(dev);
5163err_dbf: 5153err_dbf:
5164 debug_unregister(card->debug); 5154 debug_unregister(card->debug);
5165err_card: 5155err_card:
@@ -5176,14 +5166,8 @@ static void qeth_core_remove_device(struct ccwgroup_device *gdev)
5176 5166
5177 QETH_DBF_TEXT(SETUP, 2, "removedv"); 5167 QETH_DBF_TEXT(SETUP, 2, "removedv");
5178 5168
5179 if (card->info.type == QETH_CARD_TYPE_OSN) { 5169 if (card->discipline) {
5180 qeth_core_remove_osn_attributes(&gdev->dev); 5170 card->discipline->remove(gdev);
5181 } else {
5182 qeth_core_remove_device_attributes(&gdev->dev);
5183 }
5184
5185 if (card->discipline.ccwgdriver) {
5186 card->discipline.ccwgdriver->remove(gdev);
5187 qeth_core_free_discipline(card); 5171 qeth_core_free_discipline(card);
5188 } 5172 }
5189 5173
@@ -5203,7 +5187,7 @@ static int qeth_core_set_online(struct ccwgroup_device *gdev)
5203 int rc = 0; 5187 int rc = 0;
5204 int def_discipline; 5188 int def_discipline;
5205 5189
5206 if (!card->discipline.ccwgdriver) { 5190 if (!card->discipline) {
5207 if (card->info.type == QETH_CARD_TYPE_IQD) 5191 if (card->info.type == QETH_CARD_TYPE_IQD)
5208 def_discipline = QETH_DISCIPLINE_LAYER3; 5192 def_discipline = QETH_DISCIPLINE_LAYER3;
5209 else 5193 else
@@ -5211,11 +5195,11 @@ static int qeth_core_set_online(struct ccwgroup_device *gdev)
5211 rc = qeth_core_load_discipline(card, def_discipline); 5195 rc = qeth_core_load_discipline(card, def_discipline);
5212 if (rc) 5196 if (rc)
5213 goto err; 5197 goto err;
5214 rc = card->discipline.ccwgdriver->probe(card->gdev); 5198 rc = card->discipline->setup(card->gdev);
5215 if (rc) 5199 if (rc)
5216 goto err; 5200 goto err;
5217 } 5201 }
5218 rc = card->discipline.ccwgdriver->set_online(gdev); 5202 rc = card->discipline->set_online(gdev);
5219err: 5203err:
5220 return rc; 5204 return rc;
5221} 5205}
@@ -5223,58 +5207,52 @@ err:
5223static int qeth_core_set_offline(struct ccwgroup_device *gdev) 5207static int qeth_core_set_offline(struct ccwgroup_device *gdev)
5224{ 5208{
5225 struct qeth_card *card = dev_get_drvdata(&gdev->dev); 5209 struct qeth_card *card = dev_get_drvdata(&gdev->dev);
5226 return card->discipline.ccwgdriver->set_offline(gdev); 5210 return card->discipline->set_offline(gdev);
5227} 5211}
5228 5212
5229static void qeth_core_shutdown(struct ccwgroup_device *gdev) 5213static void qeth_core_shutdown(struct ccwgroup_device *gdev)
5230{ 5214{
5231 struct qeth_card *card = dev_get_drvdata(&gdev->dev); 5215 struct qeth_card *card = dev_get_drvdata(&gdev->dev);
5232 if (card->discipline.ccwgdriver && 5216 if (card->discipline && card->discipline->shutdown)
5233 card->discipline.ccwgdriver->shutdown) 5217 card->discipline->shutdown(gdev);
5234 card->discipline.ccwgdriver->shutdown(gdev);
5235} 5218}
5236 5219
5237static int qeth_core_prepare(struct ccwgroup_device *gdev) 5220static int qeth_core_prepare(struct ccwgroup_device *gdev)
5238{ 5221{
5239 struct qeth_card *card = dev_get_drvdata(&gdev->dev); 5222 struct qeth_card *card = dev_get_drvdata(&gdev->dev);
5240 if (card->discipline.ccwgdriver && 5223 if (card->discipline && card->discipline->prepare)
5241 card->discipline.ccwgdriver->prepare) 5224 return card->discipline->prepare(gdev);
5242 return card->discipline.ccwgdriver->prepare(gdev);
5243 return 0; 5225 return 0;
5244} 5226}
5245 5227
5246static void qeth_core_complete(struct ccwgroup_device *gdev) 5228static void qeth_core_complete(struct ccwgroup_device *gdev)
5247{ 5229{
5248 struct qeth_card *card = dev_get_drvdata(&gdev->dev); 5230 struct qeth_card *card = dev_get_drvdata(&gdev->dev);
5249 if (card->discipline.ccwgdriver && 5231 if (card->discipline && card->discipline->complete)
5250 card->discipline.ccwgdriver->complete) 5232 card->discipline->complete(gdev);
5251 card->discipline.ccwgdriver->complete(gdev);
5252} 5233}
5253 5234
5254static int qeth_core_freeze(struct ccwgroup_device *gdev) 5235static int qeth_core_freeze(struct ccwgroup_device *gdev)
5255{ 5236{
5256 struct qeth_card *card = dev_get_drvdata(&gdev->dev); 5237 struct qeth_card *card = dev_get_drvdata(&gdev->dev);
5257 if (card->discipline.ccwgdriver && 5238 if (card->discipline && card->discipline->freeze)
5258 card->discipline.ccwgdriver->freeze) 5239 return card->discipline->freeze(gdev);
5259 return card->discipline.ccwgdriver->freeze(gdev);
5260 return 0; 5240 return 0;
5261} 5241}
5262 5242
5263static int qeth_core_thaw(struct ccwgroup_device *gdev) 5243static int qeth_core_thaw(struct ccwgroup_device *gdev)
5264{ 5244{
5265 struct qeth_card *card = dev_get_drvdata(&gdev->dev); 5245 struct qeth_card *card = dev_get_drvdata(&gdev->dev);
5266 if (card->discipline.ccwgdriver && 5246 if (card->discipline && card->discipline->thaw)
5267 card->discipline.ccwgdriver->thaw) 5247 return card->discipline->thaw(gdev);
5268 return card->discipline.ccwgdriver->thaw(gdev);
5269 return 0; 5248 return 0;
5270} 5249}
5271 5250
5272static int qeth_core_restore(struct ccwgroup_device *gdev) 5251static int qeth_core_restore(struct ccwgroup_device *gdev)
5273{ 5252{
5274 struct qeth_card *card = dev_get_drvdata(&gdev->dev); 5253 struct qeth_card *card = dev_get_drvdata(&gdev->dev);
5275 if (card->discipline.ccwgdriver && 5254 if (card->discipline && card->discipline->restore)
5276 card->discipline.ccwgdriver->restore) 5255 return card->discipline->restore(gdev);
5277 return card->discipline.ccwgdriver->restore(gdev);
5278 return 0; 5256 return 0;
5279} 5257}
5280 5258
@@ -5283,8 +5261,7 @@ static struct ccwgroup_driver qeth_core_ccwgroup_driver = {
5283 .owner = THIS_MODULE, 5261 .owner = THIS_MODULE,
5284 .name = "qeth", 5262 .name = "qeth",
5285 }, 5263 },
5286 .driver_id = 0xD8C5E3C8, 5264 .setup = qeth_core_probe_device,
5287 .probe = qeth_core_probe_device,
5288 .remove = qeth_core_remove_device, 5265 .remove = qeth_core_remove_device,
5289 .set_online = qeth_core_set_online, 5266 .set_online = qeth_core_set_online,
5290 .set_offline = qeth_core_set_offline, 5267 .set_offline = qeth_core_set_offline,
@@ -5296,21 +5273,30 @@ static struct ccwgroup_driver qeth_core_ccwgroup_driver = {
5296 .restore = qeth_core_restore, 5273 .restore = qeth_core_restore,
5297}; 5274};
5298 5275
5299static ssize_t 5276static ssize_t qeth_core_driver_group_store(struct device_driver *ddrv,
5300qeth_core_driver_group_store(struct device_driver *ddrv, const char *buf, 5277 const char *buf, size_t count)
5301 size_t count)
5302{ 5278{
5303 int err; 5279 int err;
5304 err = qeth_core_driver_group(buf, qeth_core_root_dev,
5305 qeth_core_ccwgroup_driver.driver_id);
5306 if (err)
5307 return err;
5308 else
5309 return count;
5310}
5311 5280
5281 err = ccwgroup_create_dev(qeth_core_root_dev,
5282 &qeth_core_ccwgroup_driver, 3, buf);
5283
5284 return err ? err : count;
5285}
5312static DRIVER_ATTR(group, 0200, NULL, qeth_core_driver_group_store); 5286static DRIVER_ATTR(group, 0200, NULL, qeth_core_driver_group_store);
5313 5287
5288static struct attribute *qeth_drv_attrs[] = {
5289 &driver_attr_group.attr,
5290 NULL,
5291};
5292static struct attribute_group qeth_drv_attr_group = {
5293 .attrs = qeth_drv_attrs,
5294};
5295static const struct attribute_group *qeth_drv_attr_groups[] = {
5296 &qeth_drv_attr_group,
5297 NULL,
5298};
5299
5314static struct { 5300static struct {
5315 const char str[ETH_GSTRING_LEN]; 5301 const char str[ETH_GSTRING_LEN];
5316} qeth_ethtool_stats_keys[] = { 5302} qeth_ethtool_stats_keys[] = {
@@ -5548,49 +5534,41 @@ static int __init qeth_core_init(void)
5548 rc = qeth_register_dbf_views(); 5534 rc = qeth_register_dbf_views();
5549 if (rc) 5535 if (rc)
5550 goto out_err; 5536 goto out_err;
5551 rc = ccw_driver_register(&qeth_ccw_driver);
5552 if (rc)
5553 goto ccw_err;
5554 rc = ccwgroup_driver_register(&qeth_core_ccwgroup_driver);
5555 if (rc)
5556 goto ccwgroup_err;
5557 rc = driver_create_file(&qeth_core_ccwgroup_driver.driver,
5558 &driver_attr_group);
5559 if (rc)
5560 goto driver_err;
5561 qeth_core_root_dev = root_device_register("qeth"); 5537 qeth_core_root_dev = root_device_register("qeth");
5562 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;
5563 if (rc) 5539 if (rc)
5564 goto register_err; 5540 goto register_err;
5565
5566 qeth_core_header_cache = kmem_cache_create("qeth_hdr", 5541 qeth_core_header_cache = kmem_cache_create("qeth_hdr",
5567 sizeof(struct qeth_hdr) + ETH_HLEN, 64, 0, NULL); 5542 sizeof(struct qeth_hdr) + ETH_HLEN, 64, 0, NULL);
5568 if (!qeth_core_header_cache) { 5543 if (!qeth_core_header_cache) {
5569 rc = -ENOMEM; 5544 rc = -ENOMEM;
5570 goto slab_err; 5545 goto slab_err;
5571 } 5546 }
5572
5573 qeth_qdio_outbuf_cache = kmem_cache_create("qeth_buf", 5547 qeth_qdio_outbuf_cache = kmem_cache_create("qeth_buf",
5574 sizeof(struct qeth_qdio_out_buffer), 0, 0, NULL); 5548 sizeof(struct qeth_qdio_out_buffer), 0, 0, NULL);
5575 if (!qeth_qdio_outbuf_cache) { 5549 if (!qeth_qdio_outbuf_cache) {
5576 rc = -ENOMEM; 5550 rc = -ENOMEM;
5577 goto cqslab_err; 5551 goto cqslab_err;
5578 } 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;
5579 5560
5580 return 0; 5561 return 0;
5562
5563ccwgroup_err:
5564 ccw_driver_unregister(&qeth_ccw_driver);
5565ccw_err:
5566 kmem_cache_destroy(qeth_qdio_outbuf_cache);
5581cqslab_err: 5567cqslab_err:
5582 kmem_cache_destroy(qeth_core_header_cache); 5568 kmem_cache_destroy(qeth_core_header_cache);
5583slab_err: 5569slab_err:
5584 root_device_unregister(qeth_core_root_dev); 5570 root_device_unregister(qeth_core_root_dev);
5585register_err: 5571register_err:
5586 driver_remove_file(&qeth_core_ccwgroup_driver.driver,
5587 &driver_attr_group);
5588driver_err:
5589 ccwgroup_driver_unregister(&qeth_core_ccwgroup_driver);
5590ccwgroup_err:
5591 ccw_driver_unregister(&qeth_ccw_driver);
5592ccw_err:
5593 QETH_DBF_MESSAGE(2, "Initialization failed with code %d\n", rc);
5594 qeth_unregister_dbf_views(); 5572 qeth_unregister_dbf_views();
5595out_err: 5573out_err:
5596 pr_err("Initializing the qeth device driver failed\n"); 5574 pr_err("Initializing the qeth device driver failed\n");
@@ -5599,13 +5577,11 @@ out_err:
5599 5577
5600static void __exit qeth_core_exit(void) 5578static void __exit qeth_core_exit(void)
5601{ 5579{
5602 root_device_unregister(qeth_core_root_dev);
5603 driver_remove_file(&qeth_core_ccwgroup_driver.driver,
5604 &driver_attr_group);
5605 ccwgroup_driver_unregister(&qeth_core_ccwgroup_driver); 5580 ccwgroup_driver_unregister(&qeth_core_ccwgroup_driver);
5606 ccw_driver_unregister(&qeth_ccw_driver); 5581 ccw_driver_unregister(&qeth_ccw_driver);
5607 kmem_cache_destroy(qeth_qdio_outbuf_cache); 5582 kmem_cache_destroy(qeth_qdio_outbuf_cache);
5608 kmem_cache_destroy(qeth_core_header_cache); 5583 kmem_cache_destroy(qeth_core_header_cache);
5584 root_device_unregister(qeth_core_root_dev);
5609 qeth_unregister_dbf_views(); 5585 qeth_unregister_dbf_views();
5610 pr_info("core functions removed\n"); 5586 pr_info("core functions removed\n");
5611} 5587}
diff --git a/drivers/s390/net/qeth_core_mpc.h b/drivers/s390/net/qeth_core_mpc.h
index ff41e42004ac..a11b30c38423 100644
--- a/drivers/s390/net/qeth_core_mpc.h
+++ b/drivers/s390/net/qeth_core_mpc.h
@@ -70,16 +70,6 @@ enum qeth_link_types {
70 QETH_LINK_TYPE_ATM_NATIVE = 0x90, 70 QETH_LINK_TYPE_ATM_NATIVE = 0x90,
71}; 71};
72 72
73enum qeth_tr_macaddr_modes {
74 QETH_TR_MACADDR_NONCANONICAL = 0,
75 QETH_TR_MACADDR_CANONICAL = 1,
76};
77
78enum qeth_tr_broadcast_modes {
79 QETH_TR_BROADCAST_ALLRINGS = 0,
80 QETH_TR_BROADCAST_LOCAL = 1,
81};
82
83/* 73/*
84 * Routing stuff 74 * Routing stuff
85 */ 75 */
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);
448out: 448out:
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
697static struct attribute_group qeth_device_blkt_group = { 696static 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
720static struct attribute_group qeth_device_attr_group = { 718static struct attribute_group qeth_device_attr_group = {
721 .attrs = qeth_device_attrs, 719 .attrs = qeth_device_attrs,
722}; 720};
723 721
722const struct attribute_group *qeth_generic_attr_groups[] = {
723 &qeth_device_attr_group,
724 &qeth_device_blkt_group,
725 NULL,
726};
727
724static struct attribute *qeth_osn_device_attrs[] = { 728static 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
734static struct attribute_group qeth_osn_device_attr_group = { 737static struct attribute_group qeth_osn_device_attr_group = {
735 .attrs = qeth_osn_device_attrs, 738 .attrs = qeth_osn_device_attrs,
736}; 739};
737 740const struct attribute_group *qeth_osn_attr_groups[] = {
738int 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
751void 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
757int qeth_core_create_osn_attributes(struct device *dev)
758{
759 return sysfs_create_group(&dev->kobj, &qeth_osn_device_attr_group);
760}
761
762void 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
1230struct ccwgroup_driver qeth_l2_ccwgroup_driver = { 1224struct 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};
1240EXPORT_SYMBOL_GPL(qeth_l2_ccwgroup_driver); 1238EXPORT_SYMBOL_GPL(qeth_l2_discipline);
1241 1239
1242static int qeth_osn_send_control_data(struct qeth_card *card, int len, 1240static 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 f85921607686..7be5e9775691 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -976,57 +976,6 @@ static inline u8 qeth_l3_get_qeth_hdr_flags6(int cast_type)
976 return ct | QETH_CAST_UNICAST; 976 return ct | QETH_CAST_UNICAST;
977} 977}
978 978
979static int qeth_l3_send_setadp_mode(struct qeth_card *card, __u32 command,
980 __u32 mode)
981{
982 int rc;
983 struct qeth_cmd_buffer *iob;
984 struct qeth_ipa_cmd *cmd;
985
986 QETH_CARD_TEXT(card, 4, "adpmode");
987
988 iob = qeth_get_adapter_cmd(card, command,
989 sizeof(struct qeth_ipacmd_setadpparms));
990 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
991 cmd->data.setadapterparms.data.mode = mode;
992 rc = qeth_send_ipa_cmd(card, iob, qeth_default_setadapterparms_cb,
993 NULL);
994 return rc;
995}
996
997static int qeth_l3_setadapter_hstr(struct qeth_card *card)
998{
999 int rc;
1000
1001 QETH_CARD_TEXT(card, 4, "adphstr");
1002
1003 if (qeth_adp_supported(card, IPA_SETADP_SET_BROADCAST_MODE)) {
1004 rc = qeth_l3_send_setadp_mode(card,
1005 IPA_SETADP_SET_BROADCAST_MODE,
1006 card->options.broadcast_mode);
1007 if (rc)
1008 QETH_DBF_MESSAGE(2, "couldn't set broadcast mode on "
1009 "device %s: x%x\n",
1010 CARD_BUS_ID(card), rc);
1011 rc = qeth_l3_send_setadp_mode(card,
1012 IPA_SETADP_ALTER_MAC_ADDRESS,
1013 card->options.macaddr_mode);
1014 if (rc)
1015 QETH_DBF_MESSAGE(2, "couldn't set macaddr mode on "
1016 "device %s: x%x\n", CARD_BUS_ID(card), rc);
1017 return rc;
1018 }
1019 if (card->options.broadcast_mode == QETH_TR_BROADCAST_LOCAL)
1020 QETH_DBF_MESSAGE(2, "set adapter parameters not available "
1021 "to set broadcast mode, using ALLRINGS "
1022 "on device %s:\n", CARD_BUS_ID(card));
1023 if (card->options.macaddr_mode == QETH_TR_MACADDR_CANONICAL)
1024 QETH_DBF_MESSAGE(2, "set adapter parameters not available "
1025 "to set macaddr mode, using NONCANONICAL "
1026 "on device %s:\n", CARD_BUS_ID(card));
1027 return 0;
1028}
1029
1030static int qeth_l3_setadapter_parms(struct qeth_card *card) 979static int qeth_l3_setadapter_parms(struct qeth_card *card)
1031{ 980{
1032 int rc; 981 int rc;
@@ -1052,10 +1001,6 @@ static int qeth_l3_setadapter_parms(struct qeth_card *card)
1052 " address failed\n"); 1001 " address failed\n");
1053 } 1002 }
1054 1003
1055 if ((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
1056 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))
1057 rc = qeth_l3_setadapter_hstr(card);
1058
1059 return rc; 1004 return rc;
1060} 1005}
1061 1006
@@ -1671,10 +1616,7 @@ qeth_diags_trace(struct qeth_card *card, enum qeth_diags_trace_cmds diags_cmd)
1671static void qeth_l3_get_mac_for_ipm(__u32 ipm, char *mac, 1616static void qeth_l3_get_mac_for_ipm(__u32 ipm, char *mac,
1672 struct net_device *dev) 1617 struct net_device *dev)
1673{ 1618{
1674 if (dev->type == ARPHRD_IEEE802_TR) 1619 ip_eth_mc_map(ipm, mac);
1675 ip_tr_mc_map(ipm, mac);
1676 else
1677 ip_eth_mc_map(ipm, mac);
1678} 1620}
1679 1621
1680static void qeth_l3_add_mc(struct qeth_card *card, struct in_device *in4_dev) 1622static void qeth_l3_add_mc(struct qeth_card *card, struct in_device *in4_dev)
@@ -1922,8 +1864,6 @@ static inline int qeth_l3_rebuild_skb(struct qeth_card *card,
1922#endif 1864#endif
1923 case __constant_htons(ETH_P_IP): 1865 case __constant_htons(ETH_P_IP):
1924 ip_hdr = (struct iphdr *)skb->data; 1866 ip_hdr = (struct iphdr *)skb->data;
1925 (card->dev->type == ARPHRD_IEEE802_TR) ?
1926 ip_tr_mc_map(ip_hdr->daddr, tg_addr):
1927 ip_eth_mc_map(ip_hdr->daddr, tg_addr); 1867 ip_eth_mc_map(ip_hdr->daddr, tg_addr);
1928 break; 1868 break;
1929 default: 1869 default:
@@ -1959,12 +1899,7 @@ static inline int qeth_l3_rebuild_skb(struct qeth_card *card,
1959 tg_addr, "FAKELL", card->dev->addr_len); 1899 tg_addr, "FAKELL", card->dev->addr_len);
1960 } 1900 }
1961 1901
1962#ifdef CONFIG_TR 1902 skb->protocol = eth_type_trans(skb, card->dev);
1963 if (card->dev->type == ARPHRD_IEEE802_TR)
1964 skb->protocol = tr_type_trans(skb, card->dev);
1965 else
1966#endif
1967 skb->protocol = eth_type_trans(skb, card->dev);
1968 1903
1969 if (hdr->hdr.l3.ext_flags & 1904 if (hdr->hdr.l3.ext_flags &
1970 (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) { 1905 (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) {
@@ -2138,7 +2073,7 @@ static int qeth_l3_verify_vlan_dev(struct net_device *dev,
2138 struct net_device *netdev; 2073 struct net_device *netdev;
2139 2074
2140 rcu_read_lock(); 2075 rcu_read_lock();
2141 netdev = __vlan_find_dev_deep(dev, vid); 2076 netdev = __vlan_find_dev_deep(card->dev, vid);
2142 rcu_read_unlock(); 2077 rcu_read_unlock();
2143 if (netdev == dev) { 2078 if (netdev == dev) {
2144 rc = QETH_VLAN_CARD; 2079 rc = QETH_VLAN_CARD;
@@ -2883,13 +2818,7 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
2883 hdr->hdr.l3.flags &= ~QETH_HDR_PASSTHRU; 2818 hdr->hdr.l3.flags &= ~QETH_HDR_PASSTHRU;
2884 memcpy(hdr->hdr.l3.dest_addr, pkey, 16); 2819 memcpy(hdr->hdr.l3.dest_addr, pkey, 16);
2885 } else { 2820 } else {
2886 /* passthrough */ 2821 if (!memcmp(skb->data + sizeof(struct qeth_hdr),
2887 if ((skb->dev->type == ARPHRD_IEEE802_TR) &&
2888 !memcmp(skb->data + sizeof(struct qeth_hdr) +
2889 sizeof(__u16), skb->dev->broadcast, 6)) {
2890 hdr->hdr.l3.flags = QETH_CAST_BROADCAST |
2891 QETH_HDR_PASSTHRU;
2892 } else if (!memcmp(skb->data + sizeof(struct qeth_hdr),
2893 skb->dev->broadcast, 6)) { 2822 skb->dev->broadcast, 6)) {
2894 /* broadcast? */ 2823 /* broadcast? */
2895 hdr->hdr.l3.flags = QETH_CAST_BROADCAST | 2824 hdr->hdr.l3.flags = QETH_CAST_BROADCAST |
@@ -3031,10 +2960,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
3031 skb_pull(new_skb, ETH_HLEN); 2960 skb_pull(new_skb, ETH_HLEN);
3032 } else { 2961 } else {
3033 if (ipv == 4) { 2962 if (ipv == 4) {
3034 if (card->dev->type == ARPHRD_IEEE802_TR) 2963 skb_pull(new_skb, ETH_HLEN);
3035 skb_pull(new_skb, TR_HLEN);
3036 else
3037 skb_pull(new_skb, ETH_HLEN);
3038 } 2964 }
3039 2965
3040 if (ipv != 4 && vlan_tx_tag_present(new_skb)) { 2966 if (ipv != 4 && vlan_tx_tag_present(new_skb)) {
@@ -3318,12 +3244,8 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
3318 card->info.type == QETH_CARD_TYPE_OSX) { 3244 card->info.type == QETH_CARD_TYPE_OSX) {
3319 if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) || 3245 if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) ||
3320 (card->info.link_type == QETH_LINK_TYPE_HSTR)) { 3246 (card->info.link_type == QETH_LINK_TYPE_HSTR)) {
3321#ifdef CONFIG_TR 3247 pr_info("qeth_l3: ignoring TR device\n");
3322 card->dev = alloc_trdev(0); 3248 return -ENODEV;
3323#endif
3324 if (!card->dev)
3325 return -ENODEV;
3326 card->dev->netdev_ops = &qeth_l3_netdev_ops;
3327 } else { 3249 } else {
3328 card->dev = alloc_etherdev(0); 3250 card->dev = alloc_etherdev(0);
3329 if (!card->dev) 3251 if (!card->dev)
@@ -3376,12 +3298,6 @@ static int qeth_l3_probe_device(struct ccwgroup_device *gdev)
3376 qeth_l3_create_device_attributes(&gdev->dev); 3298 qeth_l3_create_device_attributes(&gdev->dev);
3377 card->options.layer2 = 0; 3299 card->options.layer2 = 0;
3378 card->info.hwtrap = 0; 3300 card->info.hwtrap = 0;
3379 card->discipline.start_poll = qeth_qdio_start_poll;
3380 card->discipline.input_handler = (qdio_handler_t *)
3381 qeth_qdio_input_handler;
3382 card->discipline.output_handler = (qdio_handler_t *)
3383 qeth_qdio_output_handler;
3384 card->discipline.recover = qeth_l3_recover;
3385 return 0; 3301 return 0;
3386} 3302}
3387 3303
@@ -3656,8 +3572,12 @@ out:
3656 return rc; 3572 return rc;
3657} 3573}
3658 3574
3659struct ccwgroup_driver qeth_l3_ccwgroup_driver = { 3575struct qeth_discipline qeth_l3_discipline = {
3660 .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,
3661 .remove = qeth_l3_remove_device, 3581 .remove = qeth_l3_remove_device,
3662 .set_online = qeth_l3_set_online, 3582 .set_online = qeth_l3_set_online,
3663 .set_offline = qeth_l3_set_offline, 3583 .set_offline = qeth_l3_set_offline,
@@ -3666,7 +3586,7 @@ struct ccwgroup_driver qeth_l3_ccwgroup_driver = {
3666 .thaw = qeth_l3_pm_resume, 3586 .thaw = qeth_l3_pm_resume,
3667 .restore = qeth_l3_pm_resume, 3587 .restore = qeth_l3_pm_resume,
3668}; 3588};
3669EXPORT_SYMBOL_GPL(qeth_l3_ccwgroup_driver); 3589EXPORT_SYMBOL_GPL(qeth_l3_discipline);
3670 3590
3671static int qeth_l3_ip_event(struct notifier_block *this, 3591static int qeth_l3_ip_event(struct notifier_block *this,
3672 unsigned long event, void *ptr) 3592 unsigned long event, void *ptr)
@@ -3680,9 +3600,9 @@ static int qeth_l3_ip_event(struct notifier_block *this,
3680 return NOTIFY_DONE; 3600 return NOTIFY_DONE;
3681 3601
3682 card = qeth_l3_get_card_from_dev(dev); 3602 card = qeth_l3_get_card_from_dev(dev);
3683 QETH_CARD_TEXT(card, 3, "ipevent");
3684 if (!card) 3603 if (!card)
3685 return NOTIFY_DONE; 3604 return NOTIFY_DONE;
3605 QETH_CARD_TEXT(card, 3, "ipevent");
3686 3606
3687 addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV4); 3607 addr = qeth_l3_get_addr_buffer(QETH_PROT_IPV4);
3688 if (addr != NULL) { 3608 if (addr != NULL) {
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
index d979bb26522f..4cafedf950ad 100644
--- a/drivers/s390/net/qeth_l3_sys.c
+++ b/drivers/s390/net/qeth_l3_sys.c
@@ -175,116 +175,6 @@ out:
175static DEVICE_ATTR(fake_broadcast, 0644, qeth_l3_dev_fake_broadcast_show, 175static DEVICE_ATTR(fake_broadcast, 0644, qeth_l3_dev_fake_broadcast_show,
176 qeth_l3_dev_fake_broadcast_store); 176 qeth_l3_dev_fake_broadcast_store);
177 177
178static ssize_t qeth_l3_dev_broadcast_mode_show(struct device *dev,
179 struct device_attribute *attr, char *buf)
180{
181 struct qeth_card *card = dev_get_drvdata(dev);
182
183 if (!card)
184 return -EINVAL;
185
186 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
187 (card->info.link_type == QETH_LINK_TYPE_LANE_TR)))
188 return sprintf(buf, "n/a\n");
189
190 return sprintf(buf, "%s\n", (card->options.broadcast_mode ==
191 QETH_TR_BROADCAST_ALLRINGS)?
192 "all rings":"local");
193}
194
195static ssize_t qeth_l3_dev_broadcast_mode_store(struct device *dev,
196 struct device_attribute *attr, const char *buf, size_t count)
197{
198 struct qeth_card *card = dev_get_drvdata(dev);
199 char *tmp;
200 int rc = 0;
201
202 if (!card)
203 return -EINVAL;
204
205 mutex_lock(&card->conf_mutex);
206 if ((card->state != CARD_STATE_DOWN) &&
207 (card->state != CARD_STATE_RECOVER)) {
208 rc = -EPERM;
209 goto out;
210 }
211
212 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
213 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) {
214 rc = -EINVAL;
215 goto out;
216 }
217
218 tmp = strsep((char **) &buf, "\n");
219
220 if (!strcmp(tmp, "local"))
221 card->options.broadcast_mode = QETH_TR_BROADCAST_LOCAL;
222 else if (!strcmp(tmp, "all_rings"))
223 card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS;
224 else
225 rc = -EINVAL;
226out:
227 mutex_unlock(&card->conf_mutex);
228 return rc ? rc : count;
229}
230
231static DEVICE_ATTR(broadcast_mode, 0644, qeth_l3_dev_broadcast_mode_show,
232 qeth_l3_dev_broadcast_mode_store);
233
234static ssize_t qeth_l3_dev_canonical_macaddr_show(struct device *dev,
235 struct device_attribute *attr, char *buf)
236{
237 struct qeth_card *card = dev_get_drvdata(dev);
238
239 if (!card)
240 return -EINVAL;
241
242 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
243 (card->info.link_type == QETH_LINK_TYPE_LANE_TR)))
244 return sprintf(buf, "n/a\n");
245
246 return sprintf(buf, "%i\n", (card->options.macaddr_mode ==
247 QETH_TR_MACADDR_CANONICAL)? 1:0);
248}
249
250static ssize_t qeth_l3_dev_canonical_macaddr_store(struct device *dev,
251 struct device_attribute *attr, const char *buf, size_t count)
252{
253 struct qeth_card *card = dev_get_drvdata(dev);
254 char *tmp;
255 int i, rc = 0;
256
257 if (!card)
258 return -EINVAL;
259
260 mutex_lock(&card->conf_mutex);
261 if ((card->state != CARD_STATE_DOWN) &&
262 (card->state != CARD_STATE_RECOVER)) {
263 rc = -EPERM;
264 goto out;
265 }
266
267 if (!((card->info.link_type == QETH_LINK_TYPE_HSTR) ||
268 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))) {
269 rc = -EINVAL;
270 goto out;
271 }
272
273 i = simple_strtoul(buf, &tmp, 16);
274 if ((i == 0) || (i == 1))
275 card->options.macaddr_mode = i?
276 QETH_TR_MACADDR_CANONICAL :
277 QETH_TR_MACADDR_NONCANONICAL;
278 else
279 rc = -EINVAL;
280out:
281 mutex_unlock(&card->conf_mutex);
282 return rc ? rc : count;
283}
284
285static DEVICE_ATTR(canonical_macaddr, 0644, qeth_l3_dev_canonical_macaddr_show,
286 qeth_l3_dev_canonical_macaddr_store);
287
288static ssize_t qeth_l3_dev_sniffer_show(struct device *dev, 178static ssize_t qeth_l3_dev_sniffer_show(struct device *dev,
289 struct device_attribute *attr, char *buf) 179 struct device_attribute *attr, char *buf)
290{ 180{
@@ -458,8 +348,6 @@ static struct attribute *qeth_l3_device_attrs[] = {
458 &dev_attr_route4.attr, 348 &dev_attr_route4.attr,
459 &dev_attr_route6.attr, 349 &dev_attr_route6.attr,
460 &dev_attr_fake_broadcast.attr, 350 &dev_attr_fake_broadcast.attr,
461 &dev_attr_broadcast_mode.attr,
462 &dev_attr_canonical_macaddr.attr,
463 &dev_attr_sniffer.attr, 351 &dev_attr_sniffer.attr,
464 &dev_attr_hsuid.attr, 352 &dev_attr_hsuid.attr,
465 NULL, 353 NULL,