PebbleOS v4.47.0-1312-gf1984a001
Loading...
Searching...
No Matches
phy.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <pbl/device.h>
#include <pbl/kernel/mutex.h>
#include <pbl/kernel/work.h>
#include <pbl/util/bits.h>

Data Structures

struct  pbl_net_phy_listener
 Ethernet PHY listener. More...
 
struct  pbl_net_phy_ops
 Ethernet PHY driver operations, called with the device lock held. More...
 
struct  pbl_net_phy
 Ethernet PHY. More...
 

Macros

#define PBL_NET_PHY_ADV_10_HALF   PBL_BIT(0)
 Advertise 10BASE-T half duplex.
 
#define PBL_NET_PHY_ADV_10_FULL   PBL_BIT(1)
 Advertise 10BASE-T full duplex.
 
#define PBL_NET_PHY_ADV_100_HALF   PBL_BIT(2)
 Advertise 100BASE-TX half duplex.
 
#define PBL_NET_PHY_ADV_100_FULL   PBL_BIT(3)
 Advertise 100BASE-TX full duplex.
 
#define PBL_NET_PHY_ADV_ALL
 Advertise every mode the PHY has.
 
#define PBL_NET_PHY_STATE_DEFINE(sym)
 Define the runtime state of an Ethernet PHY.
 
#define PBL_NET_PHY_INIT(sym, _name, _parent, _ops)
 Initialize a struct pbl_net_phy.
 

Enumerations

enum  pbl_net_phy_speed { PBL_NET_PHY_SPEED_10 , PBL_NET_PHY_SPEED_100 }
 Link speeds. More...
 

Functions

int pbl_net_phy_start (const struct pbl_net_phy *phy, uint32_t adv)
 Power a PHY up and start negotiating a link.
 
int pbl_net_phy_stop (const struct pbl_net_phy *phy)
 Stop a PHY and power it down.
 
void pbl_net_phy_get_link (const struct pbl_net_phy *phy, struct pbl_net_phy_link *link)
 Get the link state last reported to the listeners.
 
void pbl_net_phy_add_listener (const struct pbl_net_phy *phy, struct pbl_net_phy_listener *listener)
 Add a listener to a PHY.