summaryrefslogtreecommitdiffstats
path: root/drivers/net/smc911x.c
Commit message (Collapse)AuthorAgeFilesLines
* smc911x: fix inverted poll-for-readyAhmad Fatoum2019-08-301-1/+1
| | | | | | | | | | | The ! operator is applied wrongly to only smc91xx_reg_read's return value, when probably the intention was for it to apply to the whole expression. However, wait_on_timeout keeps looping while the condition is false, so dropping the ! is the right thing to do. Do the right thing. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: net: convert drivers to spdxOleksij Rempel2018-12-061-14/+1
| | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: smc911x: Add parsing devicetree optionsAlexander Shiyan2016-07-051-2/+15
| | | | | | | | | This patch adds parsing basic devicetree options for the smc911x driver: reg-io-width, reg-shift and smsc,force-(in/ex)ternal-phy, which makes driver usable for most DTS-based boards. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: Move smc911x eth platform_data to include/platform_dataSascha Hauer2016-04-151-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: smc911x: Add device tree supportSascha Hauer2015-06-261-0/+6
| | | | | | | There should probably be more compatible entries, but this is what the kernel driver matches for. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Make set_ethaddr argument constSascha Hauer2015-06-261-1/+1
| | | | | | | The set_ethaddr callback should not modify the MAC address passed to it, so make it const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: Pass eth_device to net_receiveSascha Hauer2014-05-151-1/+1
| | | | | | | So that barebox has the information which interface a packet came from. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove unused debug Kconfig optionsSascha Hauer2013-06-231-4/+0
| | | | | | | | | | | ENABLE_DEVICE_NOISE is used only in two network drivers and is otherwise unused. ENABLE_FLASH_NOISE is completely unused. ENABLE_PARTITION_NOISE enables DEBUG in the partition command, but this code has no debug messages at all. Remove all this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-131-9/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net smc911x: add support for external PHYAndreas Pretzsch2012-11-121-4/+93
| | | | | | | | | | On LAN9115/LAN9117/LAN9215/LAN9217, external PHYs are supported. Switch to external PHY based on hardware strap pin and/or override flags. Also add a mask to platform data selecting external PHY address to be used. Code based on linux/drivers/net/ethernet/smsc/smsc911x.c (fd9abb3d, d23f028a). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-041-1/+1
| | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-031-4/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | net: introduce phylibJean-Christophe PLAGNIOL-VILLARD2012-09-251-20/+17
|/ | | | | | | | | | | | | | | | Adapt phylib from linux switch all the driver to it reimplement mii bus This will allow to have - phy drivers - to only connect the phy at then opening of the device - if the phy is not ready or not up fail on open Same behaviour as in linux and will allow to share code and simplify porting. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* smsc911x: Check platformdata pointerJan Weitzel2012-09-101-2/+2
| | | | | | | | If pdata is NULL smc911x_probe will crash. Checking the zero initialized priv->shift results in default configuration if pdata is not set. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: fix typo pn check if the device is ready before using itJean-Christophe PLAGNIOL-VILLARD2012-09-101-1/+1
| | | | | | | the check need to be inverted Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: check if the device is ready before using itJean-Christophe PLAGNIOL-VILLARD2012-09-031-1/+11
| | | | | | | | poll the READY bit in PMT_CTRL. Any other access to the device is forbidden while this bit isn't set. Try for 100ms Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: update chip detectionJean-Christophe PLAGNIOL-VILLARD2012-09-031-26/+34
| | | | | | | Use linux kernel chip detection from 3.5 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: improve detection handleJean-Christophe PLAGNIOL-VILLARD2012-09-031-1/+20
| | | | | | | detect if the bus is swapped and report a 32bit drivers is used on a 16bit bus Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: add support to pass the shift via platform dataJean-Christophe PLAGNIOL-VILLARD2012-09-031-6/+54
| | | | | | | switch ipe337: to it at the same time to do not brake it Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: add 16bit bus width supportJean-Christophe PLAGNIOL-VILLARD2012-09-031-5/+29
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: introduce read/write opsJean-Christophe PLAGNIOL-VILLARD2012-09-031-38/+63
| | | | | | | | This will allow to replace them depending on the platform data. So we can specify shift and reg io witdh (16bit/32bit) Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: move register define to smc911x.hJean-Christophe PLAGNIOL-VILLARD2012-09-031-327/+2
| | | | | | | this make the driver more readable Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net smc911x: Use __iomem for register baseSascha Hauer2012-06-301-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net drivers: remove unused type_dataSascha Hauer2012-02-251-1/+0
| | | | | | | Many net drivers set dev->type_data without ever using it, so just remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-221-1/+1
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net mii: add a parent pointer to miidevs and set it to the hardware deviceSascha Hauer2011-08-151-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: make the ethernet device a child of the hardware deviceSascha Hauer2011-08-151-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: embed eth_device into privSascha Hauer2011-07-281-5/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: switch to use resourcesSascha Hauer2011-07-281-6/+9
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: use dev_* instead of printfSascha Hauer2011-07-281-13/+9
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net smc911x: Add LAN9221 supportSascha Hauer2011-03-301-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: fix printf compiler warningsSascha Hauer2011-01-071-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: rework the mii supportJean-Christophe PLAGNIOL-VILLARD2010-08-271-18/+15
| | | | | | | this rework is done in order to add a phylib and allow to have phy driver support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* network drivers: call net_receive directly instead of NetReceiveSascha Hauer2010-06-171-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add a device_d to ethernet devicesSascha Hauer2009-07-211-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Get rid of DEVICE_TYPE_ETHER usageSascha Hauer2009-07-211-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* smc911x: fix wrong printfSascha Hauer2009-02-201-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* [smsc911x] undef FLOW if already definedMarc Kleine-Budde2007-11-121-0/+4
| | | | | | | | | | | | | | fixes: drivers/net/smc911x.c:334:1: warning: "FLOW" redefined In file included from include/asm/blackfin.h:33, from include/asm/system.h:29, from include/asm/bitops.h:33, from include/linux/bitops.h:69, from include/common.h:31, from drivers/net/smc911x.c:29: include/asm/cpu/defBF561.h:1654:1: warning: this is the location of the previous definition Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* noisy supportJuergen Beisert2007-10-181-1/+5
|
* change functions containing 'mac' or 'enet' in its name to 'ethaddr'.sascha2007-10-181-4/+4
| | | | change the parameter name for ethernet devices to 'ethaddr' aswell.
* - coding styleSascha Hauer2007-09-121-29/+45
| | | | | - turn endless loop into timeout loop - remove preliminary debug crap
* add blackfin network driverSascha Hauer2007-09-111-0/+738