---
name: "phy_attach_direct"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/phy_attach_direct"
---

# phy\_attach\_direct(9)

attach a network device to a given PHY device pointer

## NAME

phy\_attach\_direct - attach a network device to a given PHY device pointer

## SYNOPSIS

**int phy\_attach\_direct(struct net\_device \*** *dev***, struct phy\_device \*** *phydev***, u32** *flags***, phy\_interface\_t** *interface***);**

## ARGUMENTS

*dev*

network device to attach

*phydev*

Pointer to phy\_device to attach

*flags*

PHY device's dev\_flags

*interface*

PHY device's interface

## DESCRIPTION

Called by drivers to attach to a particular PHY device. The phy\_device is found, and properly hooked up to the phy\_driver. If no driver is attached, then a generic driver is used. The phy\_device is given a ptr to the attaching device, and given a callback for link status change. The phy\_device is returned to the attaching driver. This function takes a reference on the phy device.

## COPYRIGHT
