summaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
Commit message (Collapse)AuthorAgeFilesLines
* net: gianfar: replace global NetRxPackets with per-interface allocationAhmad Fatoum2024-03-131-7/+7
| | | | | | | | | | | NetRxPackets is a remnant of times, where a board had at most one Ethernet controller. This is outdated and we should drop NetRxPackets. Switch over the driver to allocate the receive buffers needed. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313110704.1095554-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: gianfar: make MAC addr setup endian safe, cleanupSascha Hauer2023-06-061-8/+2
| | | | | | | | | | | | | | | | | | | | | | This is an adoption of Linux commit: | commit 83bfc3c4765c35ef0dfff8a3d6dedab88f3f50ea | Author: Claudiu Manoil <claudiu.manoil@freescale.com> | Date: Tue Oct 7 10:44:33 2014 +0300 | | gianfar: Make MAC addr setup endian safe, cleanup | | Fix the 32-bit memory access that is not endian safe, | i.e. not giving the desired byte layout for a LE CPU: | tempval = *((u32 *) (tmpbuf + 4)), where 'char tmpbuf[]'. | | Get rid of rendundant local vars (tmpbuf[] and idx) and | forced casts. Cleanup comments. | | Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> | Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct driver_d to driverSascha Hauer2023-01-101-3/+3
| | | | | | | | | | | The '_d' suffix was originally meant to distinguish barebox struct names from Linux struct names. struct driver doesn't exist in Linux, so we can rename it and remove the meaningless suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-101-6/+6
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: net: convert drivers to spdxOleksij Rempel2018-12-061-4/+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>
* remove checks for xzalloc() returning NULLUwe Kleine-König2017-09-261-3/+0
| | | | | | | xzalloc() either returns memory or panics, so checking for NULL is useless. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> 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>
* resource: Let dev_get_mem_region return an error pointerSascha Hauer2014-09-161-4/+7
| | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* gianfar: descriptors access with I/O accessorsRenaud Barbier2014-07-231-35/+35
| | | | | | | | As in U-Boot git-9c9141f, make read/write access to the TX/RX descriptors CPU agnostic. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> 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>
* ppc: gianfar MDIO busesRenaud Barbier2013-06-251-35/+111
| | | | | | | | | | This commit creates MDIO bus devices to separate the MDIO bus abstraction from the Ethernet device initialisation. It also updates the configuration of the P2020RDB ports. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use new device_platform_driver() macro for driversAlexander Shiyan2013-02-131-8/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net gianfar: remove unused variableSascha Hauer2012-10-171-1/+0
| | | | 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>
* net: introduce phylibJean-Christophe PLAGNIOL-VILLARD2012-09-251-35/+26
| | | | | | | | | | | | | | | | 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>
* Merge branch 'for-next/ppc'Sascha Hauer2012-09-051-1/+1
| | | | | | | Conflicts: arch/ppc/boards/freescale-p2020rdb/p2020rdb.c arch/ppc/configs/p2020rdb_defconfig arch/ppc/mach-mpc85xx/include/mach/immap_85xx.h
* net: GIANFAR driverRenaud Barbier2012-08-101-0/+548
This update adds the GIANFAR driver along with the configuration and build files. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>