ieee80211_output.c (0912bac9b3ca331086253527bb2577958c8ce5fb) ieee80211_output.c (6d049ab343c232d88119bf8528edfb0aa5273e20)
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 128 unchanged lines hidden (view full) ---

137 * Send a management frame to the specified node. The node pointer
138 * must have a reference as the pointer will be passed to the driver
139 * and potentially held for a long time. If the frame is successfully
140 * dispatched to the driver, then it is responsible for freeing the
141 * reference (and potentially free'ing up any associated storage).
142 */
143static int
144ieee80211_mgmt_output(struct ieee80211com *ic, struct ieee80211_node *ni,
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 128 unchanged lines hidden (view full) ---

137 * Send a management frame to the specified node. The node pointer
138 * must have a reference as the pointer will be passed to the driver
139 * and potentially held for a long time. If the frame is successfully
140 * dispatched to the driver, then it is responsible for freeing the
141 * reference (and potentially free'ing up any associated storage).
142 */
143static int
144ieee80211_mgmt_output(struct ieee80211com *ic, struct ieee80211_node *ni,
145 struct mbuf *m, int type)
145 struct mbuf *m, int type, int timer)
146{
147 struct ifnet *ifp = ic->ic_ifp;
148 struct ieee80211_frame *wh;
149
150 KASSERT(ni != NULL, ("null node"));
151
152 /*
153 * Yech, hack alert! We want to pass the node down to the

--- 33 unchanged lines hidden (view full) ---

187 ieee80211_mgt_subtype_name[
188 (type & IEEE80211_FC0_SUBTYPE_MASK) >>
189 IEEE80211_FC0_SUBTYPE_SHIFT],
190 ieee80211_chan2ieee(ic, ic->ic_curchan));
191 }
192#endif
193 IEEE80211_NODE_STAT(ni, tx_mgmt);
194 IF_ENQUEUE(&ic->ic_mgtq, m);
146{
147 struct ifnet *ifp = ic->ic_ifp;
148 struct ieee80211_frame *wh;
149
150 KASSERT(ni != NULL, ("null node"));
151
152 /*
153 * Yech, hack alert! We want to pass the node down to the

--- 33 unchanged lines hidden (view full) ---

187 ieee80211_mgt_subtype_name[
188 (type & IEEE80211_FC0_SUBTYPE_MASK) >>
189 IEEE80211_FC0_SUBTYPE_SHIFT],
190 ieee80211_chan2ieee(ic, ic->ic_curchan));
191 }
192#endif
193 IEEE80211_NODE_STAT(ni, tx_mgmt);
194 IF_ENQUEUE(&ic->ic_mgtq, m);
195 ifp->if_timer = 1;
195 if (timer) {
196 /*
197 * Set the mgt frame timeout.
198 */
199 ic->ic_mgt_timer = timer;
200 ifp->if_timer = 1;
201 }
196 if_start(ifp);
197 return 0;
198}
199
200/*
201 * Send a null data frame to the specified node.
202 *
203 * NB: the caller is assumed to have setup a node reference

--- 1157 unchanged lines hidden (view full) ---

1361
1362 default:
1363 IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY,
1364 "[%s] invalid mgmt frame type %u\n",
1365 ether_sprintf(ni->ni_macaddr), type);
1366 senderr(EINVAL, is_tx_unknownmgt);
1367 /* NOTREACHED */
1368 }
202 if_start(ifp);
203 return 0;
204}
205
206/*
207 * Send a null data frame to the specified node.
208 *
209 * NB: the caller is assumed to have setup a node reference

--- 1157 unchanged lines hidden (view full) ---

1367
1368 default:
1369 IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY,
1370 "[%s] invalid mgmt frame type %u\n",
1371 ether_sprintf(ni->ni_macaddr), type);
1372 senderr(EINVAL, is_tx_unknownmgt);
1373 /* NOTREACHED */
1374 }
1369
1370 ret = ieee80211_mgmt_output(ic, ni, m, type);
1371 if (ret == 0) {
1372 if (timer)
1373 ic->ic_mgt_timer = timer;
1374 } else {
1375 ret = ieee80211_mgmt_output(ic, ni, m, type, timer);
1376 if (ret != 0) {
1375bad:
1376 ieee80211_free_node(ni);
1377 }
1378 return ret;
1379#undef senderr
1380}
1381
1382/*

--- 329 unchanged lines hidden ---
1377bad:
1378 ieee80211_free_node(ni);
1379 }
1380 return ret;
1381#undef senderr
1382}
1383
1384/*

--- 329 unchanged lines hidden ---