added checks on code in dev.c for ieee80211_ptr