summaryrefslogtreecommitdiffstats
path: root/sys/dev/lge/if_lgereg.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-11-23 18:51:34 +0000
committerjhb <jhb@FreeBSD.org>2005-11-23 18:51:34 +0000
commit10794dc0a132b6d8feeb85010fa0324fb96d3eb6 (patch)
tree30d42a60cc6d0e6f7453432afefa40ff38d87504 /sys/dev/lge/if_lgereg.h
parentbc2f4ae553a0c7da583343178492ffcf306b35ba (diff)
downloadFreeBSD-src-10794dc0a132b6d8feeb85010fa0324fb96d3eb6.zip
FreeBSD-src-10794dc0a132b6d8feeb85010fa0324fb96d3eb6.tar.gz
Add locking and mark MPSAFE:
- Add locked variants of start, init, and ifmedia_upd. - Add a mutex to the softc and remove spl calls. - Use callout(9) rather than timeout(9). - Setup interrupt handler last in attach. - Use M_ZERO rather than bzero. MFC after: 1 week Tested by: wpaul
Diffstat (limited to 'sys/dev/lge/if_lgereg.h')
-rw-r--r--sys/dev/lge/if_lgereg.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/lge/if_lgereg.h b/sys/dev/lge/if_lgereg.h
index 77f4b4a..53889f3 100644
--- a/sys/dev/lge/if_lgereg.h
+++ b/sys/dev/lge/if_lgereg.h
@@ -535,7 +535,8 @@ struct lge_softc {
int lge_if_flags;
struct lge_list_data *lge_ldata;
struct lge_ring_data lge_cdata;
- struct callout_handle lge_stat_ch;
+ struct callout lge_stat_callout;
+ struct mtx lge_mtx;
SLIST_HEAD(__lge_jfreehead, lge_jpool_entry) lge_jfree_listhead;
SLIST_HEAD(__lge_jinusehead, lge_jpool_entry) lge_jinuse_listhead;
};
@@ -561,6 +562,10 @@ struct lge_softc {
#define CSR_READ_1(sc, reg) \
bus_space_read_1(sc->lge_btag, sc->lge_bhandle, reg)
+#define LGE_LOCK(sc) mtx_lock(&(sc)->lge_mtx)
+#define LGE_UNLOCK(sc) mtx_unlock(&(sc)->lge_mtx)
+#define LGE_LOCK_ASSERT(sc) mtx_assert(&(sc)->lge_mtx, MA_OWNED)
+
#define LGE_TIMEOUT 1000
#define LGE_RXLEN 1536
#define LGE_MIN_FRAMELEN 60
OpenPOWER on IntegriCloud