iwl-scan.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. /******************************************************************************
  2. *
  3. * GPL LICENSE SUMMARY
  4. *
  5. * Copyright(c) 2008 - 2010 Intel Corporation. All rights reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of version 2 of the GNU General Public License as
  9. * published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  19. * USA
  20. *
  21. * The full GNU General Public License is included in this distribution
  22. * in the file called LICENSE.GPL.
  23. *
  24. * Contact Information:
  25. * Intel Linux Wireless <ilw@linux.intel.com>
  26. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  27. *****************************************************************************/
  28. #include <linux/slab.h>
  29. #include <linux/types.h>
  30. #include <linux/etherdevice.h>
  31. #include <net/mac80211.h>
  32. #include "iwl-eeprom.h"
  33. #include "iwl-dev.h"
  34. #include "iwl-core.h"
  35. #include "iwl-sta.h"
  36. #include "iwl-io.h"
  37. #include "iwl-helpers.h"
  38. /* For active scan, listen ACTIVE_DWELL_TIME (msec) on each channel after
  39. * sending probe req. This should be set long enough to hear probe responses
  40. * from more than one AP. */
  41. #define IWL_ACTIVE_DWELL_TIME_24 (30) /* all times in msec */
  42. #define IWL_ACTIVE_DWELL_TIME_52 (20)
  43. #define IWL_ACTIVE_DWELL_FACTOR_24GHZ (3)
  44. #define IWL_ACTIVE_DWELL_FACTOR_52GHZ (2)
  45. /* For passive scan, listen PASSIVE_DWELL_TIME (msec) on each channel.
  46. * Must be set longer than active dwell time.
  47. * For the most reliable scan, set > AP beacon interval (typically 100msec). */
  48. #define IWL_PASSIVE_DWELL_TIME_24 (20) /* all times in msec */
  49. #define IWL_PASSIVE_DWELL_TIME_52 (10)
  50. #define IWL_PASSIVE_DWELL_BASE (100)
  51. #define IWL_CHANNEL_TUNE_TIME 5
  52. /**
  53. * iwl_scan_cancel - Cancel any currently executing HW scan
  54. *
  55. * NOTE: priv->mutex is not required before calling this function
  56. */
  57. int iwl_scan_cancel(struct iwl_priv *priv)
  58. {
  59. if (!test_bit(STATUS_SCAN_HW, &priv->status)) {
  60. clear_bit(STATUS_SCANNING, &priv->status);
  61. return 0;
  62. }
  63. if (test_bit(STATUS_SCANNING, &priv->status)) {
  64. if (!test_and_set_bit(STATUS_SCAN_ABORTING, &priv->status)) {
  65. IWL_DEBUG_SCAN(priv, "Queuing scan abort.\n");
  66. queue_work(priv->workqueue, &priv->abort_scan);
  67. } else
  68. IWL_DEBUG_SCAN(priv, "Scan abort already in progress.\n");
  69. return test_bit(STATUS_SCANNING, &priv->status);
  70. }
  71. return 0;
  72. }
  73. EXPORT_SYMBOL(iwl_scan_cancel);
  74. /**
  75. * iwl_scan_cancel_timeout - Cancel any currently executing HW scan
  76. * @ms: amount of time to wait (in milliseconds) for scan to abort
  77. *
  78. * NOTE: priv->mutex must be held before calling this function
  79. */
  80. int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
  81. {
  82. unsigned long now = jiffies;
  83. int ret;
  84. ret = iwl_scan_cancel(priv);
  85. if (ret && ms) {
  86. mutex_unlock(&priv->mutex);
  87. while (!time_after(jiffies, now + msecs_to_jiffies(ms)) &&
  88. test_bit(STATUS_SCANNING, &priv->status))
  89. msleep(1);
  90. mutex_lock(&priv->mutex);
  91. return test_bit(STATUS_SCANNING, &priv->status);
  92. }
  93. return ret;
  94. }
  95. EXPORT_SYMBOL(iwl_scan_cancel_timeout);
  96. static int iwl_send_scan_abort(struct iwl_priv *priv)
  97. {
  98. int ret = 0;
  99. struct iwl_rx_packet *pkt;
  100. struct iwl_host_cmd cmd = {
  101. .id = REPLY_SCAN_ABORT_CMD,
  102. .flags = CMD_WANT_SKB,
  103. };
  104. /* If there isn't a scan actively going on in the hardware
  105. * then we are in between scan bands and not actually
  106. * actively scanning, so don't send the abort command */
  107. if (!test_bit(STATUS_SCAN_HW, &priv->status)) {
  108. clear_bit(STATUS_SCAN_ABORTING, &priv->status);
  109. return 0;
  110. }
  111. ret = iwl_send_cmd_sync(priv, &cmd);
  112. if (ret) {
  113. clear_bit(STATUS_SCAN_ABORTING, &priv->status);
  114. return ret;
  115. }
  116. pkt = (struct iwl_rx_packet *)cmd.reply_page;
  117. if (pkt->u.status != CAN_ABORT_STATUS) {
  118. /* The scan abort will return 1 for success or
  119. * 2 for "failure". A failure condition can be
  120. * due to simply not being in an active scan which
  121. * can occur if we send the scan abort before we
  122. * the microcode has notified us that a scan is
  123. * completed. */
  124. IWL_DEBUG_INFO(priv, "SCAN_ABORT returned %d.\n", pkt->u.status);
  125. clear_bit(STATUS_SCAN_ABORTING, &priv->status);
  126. clear_bit(STATUS_SCAN_HW, &priv->status);
  127. }
  128. iwl_free_pages(priv, cmd.reply_page);
  129. return ret;
  130. }
  131. /* Service response to REPLY_SCAN_CMD (0x80) */
  132. static void iwl_rx_reply_scan(struct iwl_priv *priv,
  133. struct iwl_rx_mem_buffer *rxb)
  134. {
  135. #ifdef CONFIG_IWLWIFI_DEBUG
  136. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  137. struct iwl_scanreq_notification *notif =
  138. (struct iwl_scanreq_notification *)pkt->u.raw;
  139. IWL_DEBUG_RX(priv, "Scan request status = 0x%x\n", notif->status);
  140. #endif
  141. }
  142. /* Service SCAN_START_NOTIFICATION (0x82) */
  143. static void iwl_rx_scan_start_notif(struct iwl_priv *priv,
  144. struct iwl_rx_mem_buffer *rxb)
  145. {
  146. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  147. struct iwl_scanstart_notification *notif =
  148. (struct iwl_scanstart_notification *)pkt->u.raw;
  149. priv->scan_start_tsf = le32_to_cpu(notif->tsf_low);
  150. IWL_DEBUG_SCAN(priv, "Scan start: "
  151. "%d [802.11%s] "
  152. "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n",
  153. notif->channel,
  154. notif->band ? "bg" : "a",
  155. le32_to_cpu(notif->tsf_high),
  156. le32_to_cpu(notif->tsf_low),
  157. notif->status, notif->beacon_timer);
  158. }
  159. /* Service SCAN_RESULTS_NOTIFICATION (0x83) */
  160. static void iwl_rx_scan_results_notif(struct iwl_priv *priv,
  161. struct iwl_rx_mem_buffer *rxb)
  162. {
  163. #ifdef CONFIG_IWLWIFI_DEBUG
  164. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  165. struct iwl_scanresults_notification *notif =
  166. (struct iwl_scanresults_notification *)pkt->u.raw;
  167. IWL_DEBUG_SCAN(priv, "Scan ch.res: "
  168. "%d [802.11%s] "
  169. "(TSF: 0x%08X:%08X) - %d "
  170. "elapsed=%lu usec\n",
  171. notif->channel,
  172. notif->band ? "bg" : "a",
  173. le32_to_cpu(notif->tsf_high),
  174. le32_to_cpu(notif->tsf_low),
  175. le32_to_cpu(notif->statistics[0]),
  176. le32_to_cpu(notif->tsf_low) - priv->scan_start_tsf);
  177. #endif
  178. }
  179. /* Service SCAN_COMPLETE_NOTIFICATION (0x84) */
  180. static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
  181. struct iwl_rx_mem_buffer *rxb)
  182. {
  183. #ifdef CONFIG_IWLWIFI_DEBUG
  184. struct iwl_rx_packet *pkt = rxb_addr(rxb);
  185. struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
  186. IWL_DEBUG_SCAN(priv, "Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n",
  187. scan_notif->scanned_channels,
  188. scan_notif->tsf_low,
  189. scan_notif->tsf_high, scan_notif->status);
  190. #endif
  191. /* The HW is no longer scanning */
  192. clear_bit(STATUS_SCAN_HW, &priv->status);
  193. IWL_DEBUG_INFO(priv, "Scan on %sGHz took %dms\n",
  194. (priv->scan_band == IEEE80211_BAND_2GHZ) ? "2.4" : "5.2",
  195. jiffies_to_msecs(elapsed_jiffies
  196. (priv->scan_start, jiffies)));
  197. /*
  198. * If a request to abort was given, or the scan did not succeed
  199. * then we reset the scan state machine and terminate,
  200. * re-queuing another scan if one has been requested
  201. */
  202. if (test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->status))
  203. IWL_DEBUG_INFO(priv, "Aborted scan completed.\n");
  204. IWL_DEBUG_INFO(priv, "Setting scan to off\n");
  205. clear_bit(STATUS_SCANNING, &priv->status);
  206. queue_work(priv->workqueue, &priv->scan_completed);
  207. }
  208. void iwl_setup_rx_scan_handlers(struct iwl_priv *priv)
  209. {
  210. /* scan handlers */
  211. priv->rx_handlers[REPLY_SCAN_CMD] = iwl_rx_reply_scan;
  212. priv->rx_handlers[SCAN_START_NOTIFICATION] = iwl_rx_scan_start_notif;
  213. priv->rx_handlers[SCAN_RESULTS_NOTIFICATION] =
  214. iwl_rx_scan_results_notif;
  215. priv->rx_handlers[SCAN_COMPLETE_NOTIFICATION] =
  216. iwl_rx_scan_complete_notif;
  217. }
  218. EXPORT_SYMBOL(iwl_setup_rx_scan_handlers);
  219. inline u16 iwl_get_active_dwell_time(struct iwl_priv *priv,
  220. enum ieee80211_band band,
  221. u8 n_probes)
  222. {
  223. if (band == IEEE80211_BAND_5GHZ)
  224. return IWL_ACTIVE_DWELL_TIME_52 +
  225. IWL_ACTIVE_DWELL_FACTOR_52GHZ * (n_probes + 1);
  226. else
  227. return IWL_ACTIVE_DWELL_TIME_24 +
  228. IWL_ACTIVE_DWELL_FACTOR_24GHZ * (n_probes + 1);
  229. }
  230. EXPORT_SYMBOL(iwl_get_active_dwell_time);
  231. u16 iwl_get_passive_dwell_time(struct iwl_priv *priv,
  232. enum ieee80211_band band,
  233. struct ieee80211_vif *vif)
  234. {
  235. u16 passive = (band == IEEE80211_BAND_2GHZ) ?
  236. IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 :
  237. IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52;
  238. if (iwl_is_associated(priv)) {
  239. /* If we're associated, we clamp the maximum passive
  240. * dwell time to be 98% of the beacon interval (minus
  241. * 2 * channel tune time) */
  242. passive = vif ? vif->bss_conf.beacon_int : 0;
  243. if ((passive > IWL_PASSIVE_DWELL_BASE) || !passive)
  244. passive = IWL_PASSIVE_DWELL_BASE;
  245. passive = (passive * 98) / 100 - IWL_CHANNEL_TUNE_TIME * 2;
  246. }
  247. return passive;
  248. }
  249. EXPORT_SYMBOL(iwl_get_passive_dwell_time);
  250. void iwl_init_scan_params(struct iwl_priv *priv)
  251. {
  252. u8 ant_idx = fls(priv->hw_params.valid_tx_ant) - 1;
  253. if (!priv->scan_tx_ant[IEEE80211_BAND_5GHZ])
  254. priv->scan_tx_ant[IEEE80211_BAND_5GHZ] = ant_idx;
  255. if (!priv->scan_tx_ant[IEEE80211_BAND_2GHZ])
  256. priv->scan_tx_ant[IEEE80211_BAND_2GHZ] = ant_idx;
  257. }
  258. EXPORT_SYMBOL(iwl_init_scan_params);
  259. static int iwl_scan_initiate(struct iwl_priv *priv, struct ieee80211_vif *vif)
  260. {
  261. WARN_ON(!mutex_is_locked(&priv->mutex));
  262. IWL_DEBUG_INFO(priv, "Starting scan...\n");
  263. set_bit(STATUS_SCANNING, &priv->status);
  264. priv->is_internal_short_scan = false;
  265. priv->scan_start = jiffies;
  266. if (WARN_ON(!priv->cfg->ops->utils->request_scan))
  267. return -EOPNOTSUPP;
  268. priv->cfg->ops->utils->request_scan(priv, vif);
  269. return 0;
  270. }
  271. int iwl_mac_hw_scan(struct ieee80211_hw *hw,
  272. struct ieee80211_vif *vif,
  273. struct cfg80211_scan_request *req)
  274. {
  275. struct iwl_priv *priv = hw->priv;
  276. int ret;
  277. IWL_DEBUG_MAC80211(priv, "enter\n");
  278. if (req->n_channels == 0)
  279. return -EINVAL;
  280. mutex_lock(&priv->mutex);
  281. if (!iwl_is_ready_rf(priv)) {
  282. ret = -EIO;
  283. IWL_DEBUG_MAC80211(priv, "leave - not ready or exit pending\n");
  284. goto out_unlock;
  285. }
  286. if (test_bit(STATUS_SCANNING, &priv->status) &&
  287. !priv->is_internal_short_scan) {
  288. IWL_DEBUG_SCAN(priv, "Scan already in progress.\n");
  289. ret = -EAGAIN;
  290. goto out_unlock;
  291. }
  292. if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
  293. IWL_DEBUG_SCAN(priv, "Scan request while abort pending\n");
  294. ret = -EAGAIN;
  295. goto out_unlock;
  296. }
  297. /* mac80211 will only ask for one band at a time */
  298. priv->scan_band = req->channels[0]->band;
  299. priv->scan_request = req;
  300. priv->scan_vif = vif;
  301. /*
  302. * If an internal scan is in progress, just set
  303. * up the scan_request as per above.
  304. */
  305. if (priv->is_internal_short_scan)
  306. ret = 0;
  307. else
  308. ret = iwl_scan_initiate(priv, vif);
  309. IWL_DEBUG_MAC80211(priv, "leave\n");
  310. out_unlock:
  311. mutex_unlock(&priv->mutex);
  312. return ret;
  313. }
  314. EXPORT_SYMBOL(iwl_mac_hw_scan);
  315. /*
  316. * internal short scan, this function should only been called while associated.
  317. * It will reset and tune the radio to prevent possible RF related problem
  318. */
  319. void iwl_internal_short_hw_scan(struct iwl_priv *priv)
  320. {
  321. queue_work(priv->workqueue, &priv->start_internal_scan);
  322. }
  323. void iwl_bg_start_internal_scan(struct work_struct *work)
  324. {
  325. struct iwl_priv *priv =
  326. container_of(work, struct iwl_priv, start_internal_scan);
  327. mutex_lock(&priv->mutex);
  328. if (priv->is_internal_short_scan == true) {
  329. IWL_DEBUG_SCAN(priv, "Internal scan already in progress\n");
  330. goto unlock;
  331. }
  332. if (!iwl_is_ready_rf(priv)) {
  333. IWL_DEBUG_SCAN(priv, "not ready or exit pending\n");
  334. goto unlock;
  335. }
  336. if (test_bit(STATUS_SCANNING, &priv->status)) {
  337. IWL_DEBUG_SCAN(priv, "Scan already in progress.\n");
  338. goto unlock;
  339. }
  340. if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
  341. IWL_DEBUG_SCAN(priv, "Scan request while abort pending\n");
  342. goto unlock;
  343. }
  344. priv->scan_band = priv->band;
  345. IWL_DEBUG_SCAN(priv, "Start internal short scan...\n");
  346. set_bit(STATUS_SCANNING, &priv->status);
  347. priv->is_internal_short_scan = true;
  348. if (WARN_ON(!priv->cfg->ops->utils->request_scan))
  349. goto unlock;
  350. priv->cfg->ops->utils->request_scan(priv, NULL);
  351. unlock:
  352. mutex_unlock(&priv->mutex);
  353. }
  354. EXPORT_SYMBOL(iwl_bg_start_internal_scan);
  355. void iwl_bg_scan_check(struct work_struct *data)
  356. {
  357. struct iwl_priv *priv =
  358. container_of(data, struct iwl_priv, scan_check.work);
  359. if (test_bit(STATUS_EXIT_PENDING, &priv->status))
  360. return;
  361. mutex_lock(&priv->mutex);
  362. if (test_bit(STATUS_SCANNING, &priv->status) ||
  363. test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
  364. IWL_DEBUG_SCAN(priv, "Scan completion watchdog resetting "
  365. "adapter (%dms)\n",
  366. jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG));
  367. if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
  368. iwl_send_scan_abort(priv);
  369. }
  370. mutex_unlock(&priv->mutex);
  371. }
  372. EXPORT_SYMBOL(iwl_bg_scan_check);
  373. /**
  374. * iwl_fill_probe_req - fill in all required fields and IE for probe request
  375. */
  376. u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame,
  377. const u8 *ta, const u8 *ies, int ie_len, int left)
  378. {
  379. int len = 0;
  380. u8 *pos = NULL;
  381. /* Make sure there is enough space for the probe request,
  382. * two mandatory IEs and the data */
  383. left -= 24;
  384. if (left < 0)
  385. return 0;
  386. frame->frame_control = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ);
  387. memcpy(frame->da, iwl_bcast_addr, ETH_ALEN);
  388. memcpy(frame->sa, ta, ETH_ALEN);
  389. memcpy(frame->bssid, iwl_bcast_addr, ETH_ALEN);
  390. frame->seq_ctrl = 0;
  391. len += 24;
  392. /* ...next IE... */
  393. pos = &frame->u.probe_req.variable[0];
  394. /* fill in our indirect SSID IE */
  395. left -= 2;
  396. if (left < 0)
  397. return 0;
  398. *pos++ = WLAN_EID_SSID;
  399. *pos++ = 0;
  400. len += 2;
  401. if (WARN_ON(left < ie_len))
  402. return len;
  403. if (ies && ie_len) {
  404. memcpy(pos, ies, ie_len);
  405. len += ie_len;
  406. }
  407. return (u16)len;
  408. }
  409. EXPORT_SYMBOL(iwl_fill_probe_req);
  410. void iwl_bg_abort_scan(struct work_struct *work)
  411. {
  412. struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan);
  413. if (!test_bit(STATUS_READY, &priv->status) ||
  414. !test_bit(STATUS_GEO_CONFIGURED, &priv->status))
  415. return;
  416. mutex_lock(&priv->mutex);
  417. cancel_delayed_work_sync(&priv->scan_check);
  418. set_bit(STATUS_SCAN_ABORTING, &priv->status);
  419. iwl_send_scan_abort(priv);
  420. mutex_unlock(&priv->mutex);
  421. }
  422. EXPORT_SYMBOL(iwl_bg_abort_scan);
  423. void iwl_bg_scan_completed(struct work_struct *work)
  424. {
  425. struct iwl_priv *priv =
  426. container_of(work, struct iwl_priv, scan_completed);
  427. bool internal = false;
  428. IWL_DEBUG_SCAN(priv, "SCAN complete scan\n");
  429. cancel_delayed_work(&priv->scan_check);
  430. mutex_lock(&priv->mutex);
  431. if (priv->is_internal_short_scan) {
  432. priv->is_internal_short_scan = false;
  433. IWL_DEBUG_SCAN(priv, "internal short scan completed\n");
  434. internal = true;
  435. } else {
  436. priv->scan_request = NULL;
  437. priv->scan_vif = NULL;
  438. }
  439. if (test_bit(STATUS_EXIT_PENDING, &priv->status))
  440. goto out;
  441. if (internal && priv->scan_request)
  442. iwl_scan_initiate(priv, priv->scan_vif);
  443. /* Since setting the TXPOWER may have been deferred while
  444. * performing the scan, fire one off */
  445. iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
  446. /*
  447. * Since setting the RXON may have been deferred while
  448. * performing the scan, fire one off if needed
  449. */
  450. if (memcmp(&priv->active_rxon,
  451. &priv->staging_rxon, sizeof(priv->staging_rxon)))
  452. iwlcore_commit_rxon(priv);
  453. out:
  454. mutex_unlock(&priv->mutex);
  455. /*
  456. * Do not hold mutex here since this will cause mac80211 to call
  457. * into driver again into functions that will attempt to take
  458. * mutex.
  459. */
  460. if (!internal)
  461. ieee80211_scan_completed(priv->hw, false);
  462. }
  463. EXPORT_SYMBOL(iwl_bg_scan_completed);
  464. void iwl_setup_scan_deferred_work(struct iwl_priv *priv)
  465. {
  466. INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed);
  467. INIT_WORK(&priv->abort_scan, iwl_bg_abort_scan);
  468. INIT_WORK(&priv->start_internal_scan, iwl_bg_start_internal_scan);
  469. INIT_DELAYED_WORK(&priv->scan_check, iwl_bg_scan_check);
  470. }
  471. EXPORT_SYMBOL(iwl_setup_scan_deferred_work);