📄 irda_device.c
字号:
/*********************************************************************** Filename: irda_device.c* Version: 0.9* Description: Utility functions used by the device drivers* Status: Experimental.* Author: Dag Brattli <dagb@cs.uit.no>* Created at: Sat Oct 9 09:22:27 1999* Modified at: Sun Jan 23 17:41:24 2000* Modified by: Dag Brattli <dagb@cs.uit.no>** Copyright (c) 1999-2000 Dag Brattli, All Rights Reserved.* Copyright (c) 2000-2001 Jean Tourrilhes <jt@hpl.hp.com>** This program is free software; you can redistribute it and/or* modify it under the terms of the GNU General Public License as* published by the Free Software Foundation; either version 2 of* the License, or (at your option) any later version.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with this program; if not, write to the Free Software* Foundation, Inc., 59 Temple Place, Suite 330, Boston,* MA 02111-1307 USA*********************************************************************/#include <string.h>#include "skbuff.h"#include "netdevice.h"#include "irda_device.h"#include "irlap.h"#include "timer.h"#include "wrapper.h"#include "irda.h"#include <time.h>// static void __irda_task_delete(struct irda_task *task);static hashbin_t *dongles = NULL;static hashbin_t *tasks = NULL;#ifdef CONFIG_IRDA_DEBUGstatic const char *task_state[] = { "IRDA_TASK_INIT", "IRDA_TASK_DONE", "IRDA_TASK_WAIT", "IRDA_TASK_WAIT1", "IRDA_TASK_WAIT2", "IRDA_TASK_WAIT3", "IRDA_TASK_CHILD_INIT", "IRDA_TASK_CHILD_WAIT", "IRDA_TASK_CHILD_DONE",};#endif /* CONFIG_IRDA_DEBUG *//** Function irda_device_set_media_busy (self, status)** Called when we have detected that another station is transmitting* in contention mode.*/void irda_device_set_media_busy(struct net_device *dev, int status){ struct irlap_cb *self; IRDA_DEBUG(1, "%s(%s)\n", __FUNCTION__, status ? "TRUE" : "FALSE"); self = (struct irlap_cb *) dev->atalk_ptr; /* Some drivers may enable the receive interrupt before calling * irlap_open(), or they may disable the receive interrupt * after calling irlap_close(). * The IrDA stack is protected from this in irlap_driver_rcv(). * However, the driver calls directly the wrapper, that calls * us directly. Make sure we protect ourselves. * Jean II */ if (!self || self->magic != LAP_MAGIC) return; if (status) { self->media_busy = TRUE; if (status == SMALL) irlap_start_mbusy_timer(self, SMALLBUSY_TIMEOUT); else irlap_start_mbusy_timer(self, MEDIABUSY_TIMEOUT); } else { self->media_busy = FALSE; irlap_stop_mbusy_timer(self); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -