Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

UM0851 Datasheet(PDF) 58 Page - STMicroelectronics

Part # UM0851
Description  SPEAr is a family of highly customizable ARM-based embedded
PDF  245 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

UM0851 Datasheet(HTML) 58 Page - STMicroelectronics

Back Button UM0851 Datasheet HTML 54Page - STMicroelectronics UM0851 Datasheet HTML 55Page - STMicroelectronics UM0851 Datasheet HTML 56Page - STMicroelectronics UM0851 Datasheet HTML 57Page - STMicroelectronics UM0851 Datasheet HTML 58Page - STMicroelectronics UM0851 Datasheet HTML 59Page - STMicroelectronics UM0851 Datasheet HTML 60Page - STMicroelectronics UM0851 Datasheet HTML 61Page - STMicroelectronics UM0851 Datasheet HTML 62Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 58 / 245 page
background image
Communication device drivers
UM0851
58/245
Doc ID 16604 Rev 2
struct macb* bp = netdev_priv(dev);
The MACB driver interfaces to the kernel via the struct net_device data structure. The
structure fields are initialized to provide the necessary interface. The below code is a fairly
routine initialization of the struct net_device structure; it is mostly a matter of storing pointers
to our various driver functions.
struct net_device *dev;
dev->open = macb_open;
dev->stop = macb_close;
dev->do_ioctl = macb_ioctl;
dev->get_stats = macb_get_stats;
dev->hard_start_xmit = macb_start_xmit;
dev->set_multicast_list = macb_set_rx_mode;
dev->dev_addr[0-5] = MAC ADDRESS;
/*The private data structure use by the driver is */
struct macb {
void __iomem
*regs;
unsigned int
rx_tail;
struct dma_des
*rx_ring;
void
*rx_buffers;
unsigned int
tx_head, tx_tail;
unsigned int
lasttx_base;
struct dma_desc
*tx_ring;
struct ring_info
*tx_skb;
spinlock_t
lock;
struct platform_device
*pdev;
struct net_device
*dev;
struct net_device_stats stats;
struct macb_stats
hw_stats;
dma_addr_t
rx_ring_dma;
dma_addr_t
tx_ring_dma;
dma_addr_t
rx_buffers_dma;
unsigned int
rx_pending, tx_pending;
struct mii_bus
mii_bus;
struct mii_if_info
mii;
struct phy_device
*phy_dev;
unsigned int
link;
unsigned int
speed;
unsigned int
duplex;
};
PHY framework for SPEAr MACB
In the MACB driver, there is a top layer (drivers/net/arm/macb_top.c) whose function is to
scan all the PHY chips and to assign each of them to the corresponding MACB drivers.
After scanning and verifying all the PHY chips, the top layer driver creates four (or a different
number of) platform devices, which matches the MACB platform drivers. The platform
contains the struct phy_device and its corresponding MACB base register address.
The code below is in the top layer driver driver/net/arm/macb_top.c
/* register MDIO bus of MACB */
bp->mii_bus.name = "MACB_mii_bus";bp->mii_bus.read = &macb_mdio_read;bp-
>mii_bus.write = &macb_mdio_write;bp->mii_bus.reset = &macb_mdio_reset;bp-
>mii_bus.id = bp->pdev->id;



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com