Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102846545
D35497.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D35497.diff
View Options
diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c
--- a/sys/dev/dwc/if_dwc.c
+++ b/sys/dev/dwc/if_dwc.c
@@ -354,12 +354,12 @@
*/
static void
-dwc_media_status(struct ifnet * ifp, struct ifmediareq *ifmr)
+dwc_media_status(if_t ifp, struct ifmediareq *ifmr)
{
struct dwc_softc *sc;
struct mii_data *mii;
- sc = ifp->if_softc;
+ sc = if_getsoftc(ifp);
mii = sc->mii_softc;
DWC_LOCK(sc);
mii_pollstat(mii);
@@ -376,12 +376,12 @@
}
static int
-dwc_media_change(struct ifnet * ifp)
+dwc_media_change(if_t ifp)
{
struct dwc_softc *sc;
int error;
- sc = ifp->if_softc;
+ sc = if_getsoftc(ifp);
DWC_LOCK(sc);
error = dwc_media_change_locked(sc);
@@ -441,7 +441,7 @@
dwc_setup_rxfilter(struct dwc_softc *sc)
{
struct dwc_hash_maddr_ctx ctx;
- struct ifnet *ifp;
+ if_t ifp;
uint8_t *eaddr;
uint32_t ffval, hi, lo;
int nhash, i;
@@ -454,7 +454,7 @@
/*
* Set the multicast (group) filter hash.
*/
- if ((ifp->if_flags & IFF_ALLMULTI) != 0) {
+ if ((if_getflags(ifp) & IFF_ALLMULTI) != 0) {
ffval = (FRAME_FILTER_PM);
for (i = 0; i < nhash; i++)
ctx.hash[i] = ~0;
@@ -469,7 +469,7 @@
/*
* Set the individual address filter hash.
*/
- if (ifp->if_flags & IFF_PROMISC)
+ if ((if_getflags(ifp) & IFF_PROMISC) != 0)
ffval |= (FRAME_FILTER_PR);
/*
@@ -802,7 +802,7 @@
dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc,
struct dwc_bufmap *map)
{
- struct ifnet *ifp;
+ if_t ifp;
struct mbuf *m, *m0;
int len;
uint32_t rdesc0;
@@ -873,7 +873,7 @@
m_adj(m, -ETHER_CRC_LEN);
DWC_UNLOCK(sc);
- (*ifp->if_input)(ifp, m);
+ if_input(ifp, m);
DWC_LOCK(sc);
return (m0);
}
@@ -1050,7 +1050,7 @@
static void
dwc_txstart_locked(struct dwc_softc *sc)
{
- struct ifnet *ifp;
+ if_t ifp;
struct mbuf *m;
int enqueued;
@@ -1099,9 +1099,9 @@
}
static void
-dwc_txstart(struct ifnet *ifp)
+dwc_txstart(if_t ifp)
{
- struct dwc_softc *sc = ifp->if_softc;
+ struct dwc_softc *sc = if_getsoftc(ifp);
DWC_LOCK(sc);
dwc_txstart_locked(sc);
@@ -1111,7 +1111,7 @@
static void
dwc_init_locked(struct dwc_softc *sc)
{
- struct ifnet *ifp = sc->ifp;
+ if_t ifp = sc->ifp;
DWC_ASSERT_LOCKED(sc);
@@ -1146,7 +1146,7 @@
static void
dwc_stop_locked(struct dwc_softc *sc)
{
- struct ifnet *ifp;
+ if_t ifp;
DWC_ASSERT_LOCKED(sc);
@@ -1162,14 +1162,14 @@
}
static int
-dwc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
+dwc_ioctl(if_t ifp, u_long cmd, caddr_t data)
{
struct dwc_softc *sc;
struct mii_data *mii;
struct ifreq *ifr;
int flags, mask, error;
- sc = ifp->if_softc;
+ sc = if_getsoftc(ifp);
ifr = (struct ifreq *)data;
error = 0;
@@ -1238,7 +1238,7 @@
{
struct dwc_bufmap *bmap;
struct dwc_hwdesc *desc;
- struct ifnet *ifp;
+ if_t ifp;
int idx, last_idx;
bool map_finished;
@@ -1369,7 +1369,7 @@
static void
dwc_harvest_stats(struct dwc_softc *sc)
{
- struct ifnet *ifp;
+ if_t ifp;
/* We don't need to harvest too often. */
if (++sc->stats_harvest_count < STATS_HARVEST_INTERVAL)
@@ -1402,7 +1402,7 @@
dwc_tick(void *arg)
{
struct dwc_softc *sc;
- struct ifnet *ifp;
+ if_t ifp;
int link_was_up;
sc = arg;
@@ -1551,7 +1551,7 @@
{
uint8_t macaddr[ETHER_ADDR_LEN];
struct dwc_softc *sc;
- struct ifnet *ifp;
+ if_t ifp;
int error, i;
uint32_t reg;
phandle_t node;
@@ -1677,7 +1677,7 @@
/* Set up the ethernet interface. */
sc->ifp = ifp = if_alloc(IFT_ETHER);
- ifp->if_softc = sc;
+ if_setsoftc(ifp, sc);
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
if_setflags(sc->ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
if_setstartfn(ifp, dwc_txstart);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 10:35 PM (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14705847
Default Alt Text
D35497.diff (3 KB)
Attached To
Mode
D35497: if_dwc: consistently use if.c helper methods
Attached
Detach File
Event Timeline
Log In to Comment