mesh_plink.c (d585a021c0b10b0477d6b608c53e1feb8cde0507) mesh_plink.c (5bb644a0fd25a5e083ecbfaa92a211db99aa6ef7)
1/*
2 * Copyright (c) 2008 open80211s Ltd.
3 * Author: Luis Carlos Cobo <luisca@cozybit.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */

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

261
262 /*
263 * This STA is valid because sta_info_destroy() will
264 * del_timer_sync() this timer after having made sure
265 * it cannot be readded (by deleting the plink.)
266 */
267 sta = (struct sta_info *) data;
268
1/*
2 * Copyright (c) 2008 open80211s Ltd.
3 * Author: Luis Carlos Cobo <luisca@cozybit.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */

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

261
262 /*
263 * This STA is valid because sta_info_destroy() will
264 * del_timer_sync() this timer after having made sure
265 * it cannot be readded (by deleting the plink.)
266 */
267 sta = (struct sta_info *) data;
268
269 if (sta->sdata->local->quiescing) {
270 sta->plink_timer_was_running = true;
271 return;
272 }
273
269 spin_lock_bh(&sta->lock);
270 if (sta->ignore_plink_timer) {
271 sta->ignore_plink_timer = false;
272 spin_unlock_bh(&sta->lock);
273 return;
274 }
275 mpl_dbg("Mesh plink timer for %pM fired on state %d\n",
276 sta->sta.addr, sta->plink_state);

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

317 spin_unlock_bh(&sta->lock);
318 break;
319 default:
320 spin_unlock_bh(&sta->lock);
321 break;
322 }
323}
324
274 spin_lock_bh(&sta->lock);
275 if (sta->ignore_plink_timer) {
276 sta->ignore_plink_timer = false;
277 spin_unlock_bh(&sta->lock);
278 return;
279 }
280 mpl_dbg("Mesh plink timer for %pM fired on state %d\n",
281 sta->sta.addr, sta->plink_state);

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

322 spin_unlock_bh(&sta->lock);
323 break;
324 default:
325 spin_unlock_bh(&sta->lock);
326 break;
327 }
328}
329
330#ifdef CONFIG_PM
331void mesh_plink_quiesce(struct sta_info *sta)
332{
333 if (del_timer_sync(&sta->plink_timer))
334 sta->plink_timer_was_running = true;
335}
336
337void mesh_plink_restart(struct sta_info *sta)
338{
339 if (sta->plink_timer_was_running) {
340 add_timer(&sta->plink_timer);
341 sta->plink_timer_was_running = false;
342 }
343}
344#endif
345
325static inline void mesh_plink_timer_set(struct sta_info *sta, int timeout)
326{
327 sta->plink_timer.expires = jiffies + (HZ * timeout / 1000);
328 sta->plink_timer.data = (unsigned long) sta;
329 sta->plink_timer.function = mesh_plink_timer;
330 sta->plink_timeout = timeout;
331 add_timer(&sta->plink_timer);
332}

--- 384 unchanged lines hidden ---
346static inline void mesh_plink_timer_set(struct sta_info *sta, int timeout)
347{
348 sta->plink_timer.expires = jiffies + (HZ * timeout / 1000);
349 sta->plink_timer.data = (unsigned long) sta;
350 sta->plink_timer.function = mesh_plink_timer;
351 sta->plink_timeout = timeout;
352 add_timer(&sta->plink_timer);
353}

--- 384 unchanged lines hidden ---