mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
n_gsm: introduce enum gsm_dlci_mode
gsm_dlci->mode is clearly an enumeration. So introduce one and use it -- compiler now checks if valid values are assigned to the field. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20200219084949.28074-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
72ae8cc192
commit
e1785996f4
1 changed files with 6 additions and 3 deletions
|
@ -107,6 +107,11 @@ enum gsm_dlci_state {
|
||||||
DLCI_CLOSING, /* Sending DISC not seen UA/DM */
|
DLCI_CLOSING, /* Sending DISC not seen UA/DM */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum gsm_dlci_mode {
|
||||||
|
DLCI_MODE_ABM, /* Normal Asynchronous Balanced Mode */
|
||||||
|
DLCI_MODE_ADM, /* Asynchronous Disconnected Mode */
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Each active data link has a gsm_dlci structure associated which ties
|
* Each active data link has a gsm_dlci structure associated which ties
|
||||||
* the link layer to an optional tty (if the tty side is open). To avoid
|
* the link layer to an optional tty (if the tty side is open). To avoid
|
||||||
|
@ -124,9 +129,7 @@ struct gsm_dlci {
|
||||||
struct mutex mutex;
|
struct mutex mutex;
|
||||||
|
|
||||||
/* Link layer */
|
/* Link layer */
|
||||||
int mode;
|
enum gsm_dlci_mode mode;
|
||||||
#define DLCI_MODE_ABM 0 /* Normal Asynchronous Balanced Mode */
|
|
||||||
#define DLCI_MODE_ADM 1 /* Asynchronous Disconnected Mode */
|
|
||||||
spinlock_t lock; /* Protects the internal state */
|
spinlock_t lock; /* Protects the internal state */
|
||||||
struct timer_list t1; /* Retransmit timer for SABM and UA */
|
struct timer_list t1; /* Retransmit timer for SABM and UA */
|
||||||
int retries;
|
int retries;
|
||||||
|
|
Loading…
Reference in a new issue