Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

irlap_event.c File Reference

#include <linux/config.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/skbuff.h>
#include <net/irda/irda.h>
#include <net/irda/irlap_event.h>
#include <net/irda/timer.h>
#include <net/irda/irlap.h>
#include <net/irda/irlap_frame.h>
#include <net/irda/qos.h>
#include <net/irda/parameters.h>
#include <net/irda/irda_device.h>

Include dependency graph for irlap_event.c:

Go to the source code of this file.

Functions

static int irlap_state_ndm (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_query (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_reply (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_conn (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_setup (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_offline (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_xmit_p (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_pclose (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_nrm_p (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_reset_wait (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_reset (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_nrm_s (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_xmit_s (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_sclose (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
static int irlap_state_reset_check (struct irlap_cb *, IRLAP_EVENT event, struct sk_buff *, struct irlap_info *)
static void irlap_poll_timer_expired (void *data)
void irlap_start_poll_timer (struct irlap_cb *self, int timeout)
void irlap_do_event (struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)
void irlap_next_state (struct irlap_cb *self, IRLAP_STATE state)

Variables

static const char * irlap_event []
const char * irlap_state []
static int(* state [])(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info)


Function Documentation

void irlap_do_event struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
 

Definition at line 225 of file irlap_event.c.

References irlap_cb::connect_pending, CONNECT_REQUEST, irlap_cb::disconnect_pending, DISCONNECT_REQUEST, EPROTO, FALSE, IRDA_DEBUG, irlap_event, irlap_state, LAP_MAGIC, LAP_NDM, LAP_XMIT_P, LAP_XMIT_S, irlap_cb::magic, irlap_cb::media_busy, NULL, ret, SEND_I_CMD, state, irlap_cb::state, and irlap_cb::txq.

Referenced by irlap_backoff_timer_expired(), irlap_connect_request(), irlap_connect_response(), irlap_data_request(), irlap_disconnect_indication(), irlap_disconnect_request(), irlap_discovery_request(), irlap_driver_rcv(), irlap_final_timer_expired(), irlap_media_busy_expired(), irlap_poll_timer_expired(), irlap_query_timer_expired(), irlap_recv_disc_frame(), irlap_recv_discovery_xid_cmd(), irlap_recv_discovery_xid_rsp(), irlap_recv_frmr_frame(), irlap_recv_i_frame(), irlap_recv_rej_frame(), irlap_recv_rnr_frame(), irlap_recv_rr_frame(), irlap_recv_snrm_cmd(), irlap_recv_srej_frame(), irlap_recv_test_frame(), irlap_recv_ua_frame(), irlap_recv_ui_frame(), irlap_reset_indication(), irlap_slot_timer_expired(), irlap_start_poll_timer(), and irlap_wd_timer_expired().

void irlap_next_state struct irlap_cb self,
IRLAP_STATE  state
 

Definition at line 287 of file irlap_event.c.

References IRDA_DEBUG, irlap_state, LAP_MAGIC, LAP_XMIT_P, LAP_XMIT_S, and irlap_cb::magic.

Referenced by irlap_open(), irlap_state_conn(), irlap_state_ndm(), irlap_state_nrm_p(), irlap_state_nrm_s(), irlap_state_pclose(), irlap_state_query(), irlap_state_reply(), irlap_state_reset(), irlap_state_reset_check(), irlap_state_reset_wait(), irlap_state_sclose(), irlap_state_setup(), irlap_state_xmit_p(), and irlap_state_xmit_s().

static void irlap_poll_timer_expired void *  data  )  [static]
 

Definition at line 163 of file irlap_event.c.

References ASSERT, irlap_do_event(), LAP_MAGIC, NULL, and POLL_TIMER_EXPIRED.

Referenced by irlap_start_poll_timer().

Here is the call graph for this function:

void irlap_start_poll_timer struct irlap_cb self,
int  timeout
 

Definition at line 173 of file irlap_event.c.

References ASSERT, FALSE, IRDA_DEBUG, irda_start_timer(), irlap_do_event(), irlap_poll_timer_expired(), jiffies, LAP_MAGIC, irlap_cb::magic, MSECS_TO_JIFFIES, NULL, irlap_cb::poll_timer, POLL_TIMER_EXPIRED, irlap_cb::remote_busy, sysctl_fast_poll_increase, TRUE, and irlap_cb::txq.

Referenced by irlap_state_nrm_p(), and irlap_state_reset().

Here is the call graph for this function:

static int irlap_state_conn struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 625 of file irlap_event.c.

References ASSERT, CONNECT_RESPONSE, dev_kfree_skb, DISCONNECT_REQUEST, IRDA_DEBUG, irlap_apply_connection_parameters(), irlap_event, irlap_initiate_connection_state(), irlap_next_state(), irlap_qos_negotiate(), irlap_send_dm_frame(), irlap_send_ua_response_frame(), irlap_start_wd_timer(), LAP_CONN, LAP_MAGIC, LAP_NDM, LAP_NRM_S, irlap_cb::magic, irlap_cb::netdev, NULL, irlap_cb::qos_rx, RECV_DISCOVERY_XID_CMD, ret, and irlap_cb::wd_timeout.

Here is the call graph for this function:

static int irlap_state_ndm struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 314 of file irlap_event.c.

References ASSERT, irlap_info::caddr, CBROADCAST, CMD_FRAME, CONNECT_REQUEST, discovery_t::daddr, irlap_info::daddr, dev_kfree_skb, irlap_info::discovery, DISCOVERY_REQUEST, FALSE, i, IRDA_DEBUG, irda_device_set_media_busy(), irlap_connect_indication(), irlap_disconnect_indication(), irlap_discovery_confirm(), irlap_event, irlap_generate_rand_time_slot(), irlap_next_state(), irlap_send_discovery_xid_frame(), irlap_send_snrm_frame(), irlap_send_test_frame(), irlap_send_ui_frame(), irlap_start_final_timer(), irlap_start_query_timer(), irlap_start_slot_timer(), irlmp_get_discovery_response(), LAP_CONN, LAP_MAGIC, LAP_MEDIA_BUSY, LAP_NDM, LAP_QUERY, LAP_REPLY, LAP_SETUP, irlap_cb::media_busy, NULL, QUERY_TIMEOUT, RECV_DISCOVERY_XID_CMD, RECV_SNRM_CMD, RECV_TEST_CMD, RECV_TEST_RSP, RECV_UI_FRAME, ret, irlap_info::s, irlap_info::S, SEND_UI_FRAME, and TRUE.

Here is the call graph for this function:

static int irlap_state_nrm_p struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 1009 of file irlap_event.c.

References irlap_cb::add_wait, ASSERT, CMD_FRAME, del_timer(), dev_kfree_skb, FALSE, irlap_cb::final_timeout, irlap_cb::final_timer, FINAL_TIMER_EXPIRED, IRDA_DEBUG, irda_device_is_receiving(), irlap_apply_default_connection_parameters(), irlap_data_indication(), irlap_disconnect_indication(), irlap_event, irlap_flush_all_queues(), irlap_next_state(), irlap_resend_rejected_frame(), irlap_resend_rejected_frames(), irlap_reset_indication(), irlap_send_disc_frame(), irlap_send_rr_frame(), irlap_start_final_timer(), irlap_start_poll_timer(), irlap_status_indication(), irlap_update_nr_received(), irlap_validate_nr_received(), irlap_validate_ns_received(), irlap_wait_min_turn_around(), LAP_NDM, LAP_NO_RESPONSE, LAP_NRM_P, LAP_PCLOSE, LAP_RESET_INDICATION, LAP_RESET_WAIT, LAP_XMIT_P, MSECS_TO_JIFFIES, irlap_cb::N1, irlap_cb::N2, irlap_cb::netdev, irlap_info::nr, NR_EXPECTED, NR_INVALID, NR_UNEXPECTED, irlap_info::ns, NS_EXPECTED, NS_INVALID, NS_UNEXPECTED, NULL, irlap_info::pf, irlap_cb::poll_timeout, irlap_cb::qos_tx, RECV_FRMR_RSP, RECV_I_RSP, RECV_RD_RSP, RECV_REJ_RSP, RECV_RNR_RSP, RECV_RR_RSP, RECV_SREJ_RSP, RECV_UI_FRAME, irlap_cb::remote_busy, ret, irlap_cb::retry_count, STATUS_NO_ACTIVITY, TRUE, irlap_cb::va, irlap_cb::vr, and irlap_cb::vs.

Here is the call graph for this function:

static int irlap_state_nrm_s struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 1634 of file irlap_event.c.

References ASSERT, irlap_cb::caddr, CMD_FRAME, irlap_info::daddr, del_timer(), dev_kfree_skb, EINVAL, FALSE, IRDA_DEBUG, irda_start_timer(), irlap_apply_default_connection_parameters(), irlap_data_indication(), irlap_disconnect_indication(), irlap_event, irlap_flush_all_queues(), irlap_next_state(), irlap_resend_rejected_frame(), irlap_resend_rejected_frames(), irlap_reset_indication(), irlap_send_rr_frame(), irlap_send_test_frame(), irlap_send_ua_response_frame(), irlap_start_wd_timer(), irlap_status_indication(), irlap_update_nr_received(), irlap_validate_nr_received(), irlap_validate_ns_received(), irlap_wait_min_turn_around(), LAP_ADDR_HEADER, LAP_CTRL_HEADER, LAP_DISC_INDICATION, LAP_MAGIC, LAP_NDM, LAP_NO_RESPONSE, LAP_NRM_S, LAP_RESET_CHECK, LAP_XMIT_S, irlap_cb::magic, irlap_cb::N1, irlap_cb::N2, irlap_info::nr, NR_EXPECTED, NR_INVALID, NR_UNEXPECTED, irlap_info::ns, NS_EXPECTED, NS_INVALID, NS_UNEXPECTED, NULL, irlap_info::pf, irlap_cb::qos_tx, RECV_DISC_CMD, RECV_DISCOVERY_XID_CMD, RECV_I_CMD, RECV_REJ_CMD, RECV_RR_CMD, RECV_SNRM_CMD, RECV_SREJ_CMD, RECV_TEST_CMD, RECV_UI_FRAME, irlap_cb::remote_busy, ret, irlap_cb::retry_count, RSP_FRAME, STATUS_NO_ACTIVITY, TRUE, irlap_cb::txq, irlap_cb::vr, irlap_cb::vs, irlap_cb::wd_timeout, irlap_cb::wd_timer, WD_TIMER_EXPIRED, and irlap_cb::window.

Here is the call graph for this function:

static int irlap_state_offline struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 830 of file irlap_event.c.

References IRDA_DEBUG.

static int irlap_state_pclose struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 949 of file irlap_event.c.

References ASSERT, del_timer(), dev_kfree_skb, irlap_cb::final_timeout, irlap_cb::final_timer, FINAL_TIMER_EXPIRED, IRDA_DEBUG, irlap_apply_default_connection_parameters(), irlap_disconnect_indication(), irlap_next_state(), irlap_send_disc_frame(), irlap_start_final_timer(), irlap_wait_min_turn_around(), LAP_DISC_INDICATION, LAP_MAGIC, LAP_NDM, LAP_NO_RESPONSE, irlap_cb::magic, irlap_cb::N3, NULL, irlap_cb::qos_tx, RECV_DM_RSP, RECV_UA_RSP, ret, and irlap_cb::retry_count.

Here is the call graph for this function:

static int irlap_state_query struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 470 of file irlap_event.c.

References ASSERT, discovery_t::daddr, dev_kfree_skb, irlap_info::discovery, irlap_cb::discovery_cmd, irlap_cb::discovery_log, hashbin_insert(), IRDA_DEBUG, irda_device_is_receiving(), irlap_discovery_confirm(), irlap_event, irlap_next_state(), irlap_send_discovery_xid_frame(), irlap_start_slot_timer(), LAP_MAGIC, LAP_NDM, LAP_QUERY, irlap_cb::magic, MSECS_TO_JIFFIES, irlap_cb::netdev, NULL, RECV_DISCOVERY_XID_RSP, ret, irlap_cb::S, irlap_cb::s, irlap_cb::slot_timeout, SLOT_TIMER_EXPIRED, TRUE, WARNING, and xff.

Here is the call graph for this function:

static int irlap_state_reply struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 563 of file irlap_event.c.

References ASSERT, irlap_info::daddr, discovery_t::daddr, del_timer(), dev_kfree_skb, irlap_info::discovery, FALSE, irlap_cb::frame_sent, IRDA_DEBUG, irlap_discovery_indication(), irlap_event, irlap_next_state(), irlap_send_discovery_xid_frame(), irlmp_get_discovery_response(), jiffies, LAP_MAGIC, LAP_NDM, LAP_REPLY, irlap_cb::magic, NULL, irlap_cb::query_timer, QUERY_TIMER_EXPIRED, RECV_DISCOVERY_XID_CMD, ret, irlap_info::S, irlap_info::s, irlap_cb::slot, TRUE, and xff.

Here is the call graph for this function:

static int irlap_state_reset struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 1451 of file irlap_event.c.

References ASSERT, del_timer(), dev_kfree_skb, FALSE, irlap_cb::final_timeout, irlap_cb::final_timer, FINAL_TIMER_EXPIRED, IRDA_DEBUG, irlap_apply_default_connection_parameters(), irlap_disconnect_indication(), irlap_event, irlap_initiate_connection_state(), irlap_next_state(), irlap_reset_confirm(), irlap_send_snrm_frame(), irlap_send_ua_response_frame(), irlap_start_final_timer(), irlap_start_poll_timer(), irlap_start_wd_timer(), irlap_wait_min_turn_around(), LAP_MAGIC, LAP_NDM, LAP_NO_RESPONSE, LAP_RESET, LAP_XMIT_P, irlap_cb::magic, irlap_cb::N3, irlap_cb::netdev, NULL, irlap_cb::poll_timeout, irlap_cb::qos_dev, irlap_cb::qos_rx, irlap_cb::qos_tx, RECV_DISC_CMD, RECV_SNRM_CMD, RECV_UA_RSP, ret, irlap_cb::retry_count, and irlap_cb::wd_timeout.

Here is the call graph for this function:

static int irlap_state_reset_check struct irlap_cb ,
IRLAP_EVENT  event,
struct sk_buff ,
struct irlap_info
[static]
 

Definition at line 2040 of file irlap_event.c.

References ASSERT, dev_kfree_skb, DISCONNECT_REQUEST, EBADR, EINVAL, ENODEV, IRDA_DEBUG, irlap_event, irlap_flush_all_queues(), irlap_initiate_connection_state(), irlap_next_state(), irlap_send_rd_frame(), irlap_send_ua_response_frame(), irlap_start_wd_timer(), irlap_wait_min_turn_around(), LAP_MAGIC, LAP_NRM_S, LAP_SCLOSE, irlap_cb::magic, NULL, RESET_RESPONSE, ret, and WD_TIMEOUT.

Here is the call graph for this function:

static int irlap_state_reset_wait struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 1402 of file irlap_event.c.

References ASSERT, dev_kfree_skb, DISCONNECT_REQUEST, irlap_cb::final_timeout, IRDA_DEBUG, irlap_event, irlap_flush_all_queues(), irlap_next_state(), irlap_send_disc_frame(), irlap_send_snrm_frame(), irlap_start_final_timer(), irlap_wait_min_turn_around(), LAP_MAGIC, LAP_PCLOSE, LAP_RESET, irlap_cb::magic, NULL, irlap_cb::qos_tx, RESET_REQUEST, ret, and irlap_cb::xmitflag.

Here is the call graph for this function:

static int irlap_state_sclose struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 1989 of file irlap_event.c.

References ASSERT, del_timer(), dev_kfree_skb, EBADR, EINVAL, ENODEV, IRDA_DEBUG, irlap_apply_default_connection_parameters(), irlap_disconnect_indication(), irlap_event, irlap_next_state(), irlap_send_ua_response_frame(), irlap_wait_min_turn_around(), LAP_DISC_INDICATION, LAP_MAGIC, LAP_NDM, irlap_cb::magic, NULL, RECV_DISC_CMD, RECV_DM_RSP, ret, and WD_TIMER_EXPIRED.

Here is the call graph for this function:

static int irlap_state_setup struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 706 of file irlap_event.c.

References ASSERT, BACKOFF_TIMER_EXPIRED, CMD_FRAME, irlap_info::daddr, del_timer(), dev_kfree_skb, irlap_cb::final_timeout, irlap_cb::final_timer, FINAL_TIMER_EXPIRED, IRDA_DEBUG, irlap_apply_connection_parameters(), irlap_connect_confirm(), irlap_disconnect_indication(), irlap_event, irlap_initiate_connection_state(), irlap_next_state(), irlap_qos_negotiate(), irlap_send_rr_frame(), irlap_send_snrm_frame(), irlap_send_ua_response_frame(), irlap_start_backoff_timer(), irlap_start_final_timer(), irlap_start_wd_timer(), jiffies, LAP_DISC_INDICATION, LAP_FOUND_NONE, LAP_MAGIC, LAP_NDM, LAP_NRM_P, LAP_NRM_S, LAP_SETUP, sk_buff::len, irlap_cb::magic, MSECS_TO_JIFFIES, irlap_cb::N3, irlap_cb::netdev, NULL, irlap_cb::qos_rx, RECV_DISC_CMD, RECV_DM_RSP, RECV_SNRM_CMD, RECV_UA_RSP, ret, irlap_cb::retry_count, irlap_cb::saddr, and irlap_cb::wd_timeout.

Here is the call graph for this function:

static int irlap_state_xmit_p struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 846 of file irlap_event.c.

References irlap_cb::bytes_left, CMD_FRAME, del_timer(), dev_kfree_skb, DISCONNECT_REQUEST, EINVAL, EPROTO, FALSE, irlap_cb::final_timeout, IRDA_DEBUG, irlap_event, irlap_flush_all_queues(), irlap_next_state(), irlap_send_data_primary(), irlap_send_data_primary_poll(), irlap_send_disc_frame(), irlap_send_rr_frame(), irlap_start_final_timer(), irlap_wait_min_turn_around(), jiffies, LAP_NRM_P, LAP_PCLOSE, LAP_XMIT_P, sk_buff::len, irlap_cb::poll_timer, POLL_TIMER_EXPIRED, irlap_cb::qos_tx, irlap_cb::remote_busy, ret, SEND_I_CMD, irlap_cb::txq, and irlap_cb::window.

Here is the call graph for this function:

static int irlap_state_xmit_s struct irlap_cb self,
IRLAP_EVENT  event,
struct sk_buff skb,
struct irlap_info info
[static]
 

Definition at line 1548 of file irlap_event.c.

References ASSERT, irlap_cb::bytes_left, dev_kfree_skb, DISCONNECT_REQUEST, EBADR, EINVAL, ENODEV, EPROTO, IRDA_DEBUG, irlap_event, irlap_flush_all_queues(), irlap_next_state(), irlap_send_data_secondary(), irlap_send_data_secondary_final(), irlap_send_rd_frame(), irlap_start_wd_timer(), LAP_MAGIC, LAP_NRM_S, LAP_SCLOSE, LAP_XMIT_S, sk_buff::len, irlap_cb::magic, NULL, irlap_cb::remote_busy, ret, SEND_I_CMD, irlap_cb::txq, irlap_cb::wd_timeout, and irlap_cb::window.

Here is the call graph for this function:


Variable Documentation

const char* irlap_event[] [static]
 

Definition at line 79 of file irlap_event.c.

Referenced by irlap_do_event(), irlap_state_conn(), irlap_state_ndm(), irlap_state_nrm_p(), irlap_state_nrm_s(), irlap_state_query(), irlap_state_reply(), irlap_state_reset(), irlap_state_reset_check(), irlap_state_reset_wait(), irlap_state_sclose(), irlap_state_setup(), irlap_state_xmit_p(), and irlap_state_xmit_s().

const char* irlap_state[]
 

Initial value:

 {
        "LAP_NDM",
        "LAP_QUERY",
        "LAP_REPLY",
        "LAP_CONN",
        "LAP_SETUP",
        "LAP_OFFLINE",
        "LAP_XMIT_P",
        "LAP_PCLOSE",
        "LAP_NRM_P",
        "LAP_RESET_WAIT",
        "LAP_RESET",
        "LAP_NRM_S",
        "LAP_XMIT_S",
        "LAP_SCLOSE",
        "LAP_RESET_CHECK",
}

Definition at line 119 of file irlap_event.c.

Referenced by irlap_do_event(), and irlap_next_state().

int(* state[])(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) [static]
 

Initial value:

Definition at line 137 of file irlap_event.c.