linux/net/nfc/hci/llc_shdlc.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * shdlc Link Layer Control
 *
 * Copyright (C) 2012  Intel Corporation. All rights reserved.
 */

#define pr_fmt(fmt)

#include <linux/types.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/slab.h>
#include <linux/skbuff.h>

#include "llc.h"

enum shdlc_state {};

struct llc_shdlc {};

#define SHDLC_LLC_HEAD_ROOM

#define SHDLC_MAX_WINDOW
#define SHDLC_SREJ_SUPPORT

#define SHDLC_CONTROL_HEAD_MASK
#define SHDLC_CONTROL_HEAD_I
#define SHDLC_CONTROL_HEAD_I2
#define SHDLC_CONTROL_HEAD_S
#define SHDLC_CONTROL_HEAD_U

#define SHDLC_CONTROL_NS_MASK
#define SHDLC_CONTROL_NR_MASK
#define SHDLC_CONTROL_TYPE_MASK

#define SHDLC_CONTROL_M_MASK

enum sframe_type {};

enum uframe_modifier {};

#define SHDLC_CONNECT_VALUE_MS
#define SHDLC_T1_VALUE_MS(w)
#define SHDLC_T2_VALUE_MS

#define SHDLC_DUMP_SKB(info, skb)

/* checks x < y <= z modulo 8 */
static bool llc_shdlc_x_lt_y_lteq_z(int x, int y, int z)
{}

/* checks x <= y < z modulo 8 */
static bool llc_shdlc_x_lteq_y_lt_z(int x, int y, int z)
{}

static struct sk_buff *llc_shdlc_alloc_skb(const struct llc_shdlc *shdlc,
					   int payload_len)
{}

/* immediately sends an S frame. */
static int llc_shdlc_send_s_frame(const struct llc_shdlc *shdlc,
				  enum sframe_type sframe_type, int nr)
{}

/* immediately sends an U frame. skb may contain optional payload */
static int llc_shdlc_send_u_frame(const struct llc_shdlc *shdlc,
				  struct sk_buff *skb,
				  enum uframe_modifier uframe_modifier)
{}

/*
 * Free ack_pending frames until y_nr - 1, and reset t2 according to
 * the remaining oldest ack_pending frame sent time
 */
static void llc_shdlc_reset_t2(struct llc_shdlc *shdlc, int y_nr)
{}

/*
 * Receive validated frames from lower layer. skb contains HCI payload only.
 * Handle according to algorithm at spec:10.8.2
 */
static void llc_shdlc_rcv_i_frame(struct llc_shdlc *shdlc,
				  struct sk_buff *skb, int ns, int nr)
{}

static void llc_shdlc_rcv_ack(struct llc_shdlc *shdlc, int y_nr)
{}

static void llc_shdlc_requeue_ack_pending(struct llc_shdlc *shdlc)
{}

static void llc_shdlc_rcv_rej(struct llc_shdlc *shdlc, int y_nr)
{}

/* See spec RR:10.8.3 REJ:10.8.4 */
static void llc_shdlc_rcv_s_frame(struct llc_shdlc *shdlc,
				  enum sframe_type s_frame_type, int nr)
{}

static void llc_shdlc_connect_complete(struct llc_shdlc *shdlc, int r)
{}

static int llc_shdlc_connect_initiate(const struct llc_shdlc *shdlc)
{}

static int llc_shdlc_connect_send_ua(const struct llc_shdlc *shdlc)
{}

static void llc_shdlc_rcv_u_frame(struct llc_shdlc *shdlc,
				  struct sk_buff *skb,
				  enum uframe_modifier u_frame_modifier)
{}

static void llc_shdlc_handle_rcv_queue(struct llc_shdlc *shdlc)
{}

static int llc_shdlc_w_used(int ns, int dnr)
{}

/* Send frames according to algorithm at spec:10.8.1 */
static void llc_shdlc_handle_send_queue(struct llc_shdlc *shdlc)
{}

static void llc_shdlc_connect_timeout(struct timer_list *t)
{}

static void llc_shdlc_t1_timeout(struct timer_list *t)
{}

static void llc_shdlc_t2_timeout(struct timer_list *t)
{}

static void llc_shdlc_sm_work(struct work_struct *work)
{}

/*
 * Called from syscall context to establish shdlc link. Sleeps until
 * link is ready or failure.
 */
static int llc_shdlc_connect(struct llc_shdlc *shdlc)
{}

static void llc_shdlc_disconnect(struct llc_shdlc *shdlc)
{}

/*
 * Receive an incoming shdlc frame. Frame has already been crc-validated.
 * skb contains only LLC header and payload.
 * If skb == NULL, it is a notification that the link below is dead.
 */
static void llc_shdlc_recv_frame(struct llc_shdlc *shdlc, struct sk_buff *skb)
{}

static void *llc_shdlc_init(struct nfc_hci_dev *hdev, xmit_to_drv_t xmit_to_drv,
			    rcv_to_hci_t rcv_to_hci, int tx_headroom,
			    int tx_tailroom, int *rx_headroom, int *rx_tailroom,
			    llc_failure_t llc_failure)
{}

static void llc_shdlc_deinit(struct nfc_llc *llc)
{}

static int llc_shdlc_start(struct nfc_llc *llc)
{}

static int llc_shdlc_stop(struct nfc_llc *llc)
{}

static void llc_shdlc_rcv_from_drv(struct nfc_llc *llc, struct sk_buff *skb)
{}

static int llc_shdlc_xmit_from_hci(struct nfc_llc *llc, struct sk_buff *skb)
{}

static const struct nfc_llc_ops llc_shdlc_ops =;

int nfc_llc_shdlc_register(void)
{}