From 4b15c4cb50ef10b1c14f4b89e6b2dfd85bc2f01d Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 30 Jun 2008 18:08:26 -0500 Subject: [PATCH 10/12] libfc fcoe: coding style fixups - use uX for definitions I never knew there were so many ways to define a int. This driver probably uses them all which makes my eyes hurt. This patch has us use the uX/__uX definitions or unsigned int/long instead of the bsd or sys way of defining them (yeah we actually use them both). This patch also fixes some tabbing in the includes where we were using spaces instead of tabs. Signed-off-by: Mike Christie --- drivers/scsi/fcoe/fc_fcoe.h | 2 +- drivers/scsi/fcoe/fcoe_def.h | 30 +++--- drivers/scsi/fcoe/fcoe_dev.c | 26 +++--- drivers/scsi/fcoe/fcoe_if.c | 4 +- drivers/scsi/fcoe/fcoeinit.c | 2 +- drivers/scsi/libfc/fc_attr.c | 2 +- drivers/scsi/libfc/fc_disc.c | 27 +++--- drivers/scsi/libfc/fc_exch.c | 65 +++++++------- drivers/scsi/libfc/fc_frame.c | 18 ++-- drivers/scsi/libfc/fc_lport.c | 29 +++---- drivers/scsi/libfc/fc_rport.c | 28 +++--- drivers/scsi/libfc/fc_scsi.c | 34 ++++---- include/scsi/fc/fc_els.h | 6 +- include/scsi/fc/fc_encaps.h | 110 ++++++++++++------------ include/scsi/fc/fc_fc2.h | 40 +++++----- include/scsi/libfc/fc_frame.h | 4 +- include/scsi/libfc/libfc.h | 190 ++++++++++++++++++++-------------------- 17 files changed, 305 insertions(+), 312 deletions(-) diff --git a/drivers/scsi/fcoe/fc_fcoe.h b/drivers/scsi/fcoe/fc_fcoe.h index d8d187a..2f89842 100644 --- a/drivers/scsi/fcoe/fc_fcoe.h +++ b/drivers/scsi/fcoe/fc_fcoe.h @@ -53,7 +53,7 @@ * Ethernet Addresses based on FC S_ID and D_ID. * Generated by FC_FCOE_OUI | S_ID/D_ID */ -#define FC_FCOE_ENCAPS_ID(n) (((u_int64_t) FC_FCOE_OUI << 24) | (n)) +#define FC_FCOE_ENCAPS_ID(n) (((u64) FC_FCOE_OUI << 24) | (n)) #define FC_FCOE_DECAPS_ID(n) ((n) >> 24) /* diff --git a/drivers/scsi/fcoe/fcoe_def.h b/drivers/scsi/fcoe/fcoe_def.h index f8b2237..f053b50 100644 --- a/drivers/scsi/fcoe/fcoe_def.h +++ b/drivers/scsi/fcoe/fcoe_def.h @@ -66,17 +66,17 @@ struct fcoe_softc { struct net_device *phys_dev; /* device with ethtool_ops */ struct packet_type fcoe_packet_type; struct sk_buff_head fcoe_pending_queue; - uint16_t user_mfs; /* configured max frame size */ + u16 user_mfs; /* configured max frame size */ - uint8_t dest_addr[ETH_ALEN]; - uint8_t ctl_src_addr[ETH_ALEN]; - uint8_t data_src_addr[ETH_ALEN]; + u8 dest_addr[ETH_ALEN]; + u8 ctl_src_addr[ETH_ALEN]; + u8 data_src_addr[ETH_ALEN]; /* * fcoe protocol address learning related stuff */ - uint16_t flogi_oxid; - uint8_t flogi_progress; - uint8_t address_mode; + u16 flogi_oxid; + u8 flogi_progress; + u8 address_mode; }; /* @@ -84,14 +84,14 @@ struct fcoe_softc { */ extern struct fcoe_info fcoei; -void fcoe_clean_pending_queue(struct fc_lport *fd); -void fcoe_watchdog(ulong vp); -int fcoe_destroy_interface(const char *ifname); -int fcoe_create_interface(const char *ifname); -int fcoe_xmit(struct fc_lport *, struct fc_frame *); -int fcoe_rcv(struct sk_buff *, struct net_device *, - struct packet_type *, struct net_device *); -int fcoe_link_ok(struct fc_lport *); +void fcoe_clean_pending_queue(struct fc_lport *fd); +void fcoe_watchdog(ulong vp); +int fcoe_destroy_interface(const char *ifname); +int fcoe_create_interface(const char *ifname); +int fcoe_xmit(struct fc_lport *, struct fc_frame *); +int fcoe_rcv(struct sk_buff *, struct net_device *, + struct packet_type *, struct net_device *); +int fcoe_link_ok(struct fc_lport *); void fcoe_put_dev(struct fc_lport *dev); struct fcoe_softc *fcoe_find_fc_lport(const char *); #endif /* _FCOE_DEF_H_ */ diff --git a/drivers/scsi/fcoe/fcoe_dev.c b/drivers/scsi/fcoe/fcoe_dev.c index 532092b..c04ec45 100644 --- a/drivers/scsi/fcoe/fcoe_dev.c +++ b/drivers/scsi/fcoe/fcoe_dev.c @@ -72,9 +72,9 @@ int fcoe_rcv(struct sk_buff *skb, struct net_device *dev, struct fcoe_rcv_info *fr; struct fcoe_softc *fc; struct fcoe_dev_stats *stats; - u_int8_t *data; + u8 *data; struct fc_frame_header *fh; - ushort oxid; + unsigned short oxid; int cpu_idx; struct fcoe_percpu_s *fps; struct fcoe_info *fci = &fcoei; @@ -199,21 +199,21 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp) { int indx; int wlen, rc = 0; - u_int32_t crc; + u32 crc; struct ethhdr *eh; struct fcoe_crc_eof *cp; struct sk_buff *skb; struct fcoe_dev_stats *stats; struct fc_frame_header *fh; - u_int hlen; /* header length implies the version */ - u_int tlen; /* trailer length */ + unsigned int hlen; /* header length implies the version */ + unsigned int tlen; /* trailer length */ int flogi_in_progress = 0; struct fcoe_softc *fc; void *data; - uint8_t sof, eof; + u8 sof, eof; struct fcoe_hdr *hp; - WARN_ON((fr_len(fp) % sizeof(uint32_t)) != 0); + WARN_ON((fr_len(fp) % sizeof(u32)) != 0); fc = (struct fcoe_softc *)lp->drv_priv; /* @@ -249,11 +249,11 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp) for (indx = 0; indx < skb_shinfo(skb)->nr_frags; indx++) { skb_frag_t *frag = &skb_shinfo(skb)->frags[indx]; - u_long off = frag->page_offset; - u_long len = frag->size; + unsigned long off = frag->page_offset; + unsigned long len = frag->size; while (len > 0) { - u_long clen; + unsigned long clen; clen = min(len, PAGE_SIZE - (off & ~PAGE_MASK)); data = kmap_atomic(frag->page + (off >> PAGE_SHIFT), @@ -358,9 +358,9 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp) int fcoe_percpu_receive_thread(void *arg) { struct fcoe_percpu_s *p = arg; - u_int32_t fr_len; - u_int hlen; - u_int tlen; + u32 fr_len; + unsigned int hlen; + unsigned int tlen; struct fc_lport *lp; struct fcoe_rcv_info *fr; struct fcoe_dev_stats *stats; diff --git a/drivers/scsi/fcoe/fcoe_if.c b/drivers/scsi/fcoe/fcoe_if.c index 593e2cf..7e42d0d 100644 --- a/drivers/scsi/fcoe/fcoe_if.c +++ b/drivers/scsi/fcoe/fcoe_if.c @@ -60,8 +60,8 @@ extern struct scsi_transport_template *fcoe_transport_template; /* * Convert 48-bit IEEE MAC address to 64-bit FC WWN. */ -fc_wwn_t fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], uint scheme, - uint port) { +fc_wwn_t fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], unsigned int scheme, + unsigned int port) { fc_wwn_t wwn; u64 host_mac; diff --git a/drivers/scsi/fcoe/fcoeinit.c b/drivers/scsi/fcoe/fcoeinit.c index 5556c3e..e681e5e 100644 --- a/drivers/scsi/fcoe/fcoeinit.c +++ b/drivers/scsi/fcoe/fcoeinit.c @@ -377,7 +377,7 @@ out_chrdev: static void __exit fcoe_exit(void) { - uint32_t idx; + u32 idx; struct fcoe_softc *fc, *tmp; struct fc_lport *lp; struct fcoe_info *fci = &fcoei; diff --git a/drivers/scsi/libfc/fc_attr.c b/drivers/scsi/libfc/fc_attr.c index cfae66c..4a8ef20 100644 --- a/drivers/scsi/libfc/fc_attr.c +++ b/drivers/scsi/libfc/fc_attr.c @@ -84,7 +84,7 @@ void fc_get_rport_loss_tmo(struct fc_rport *rport) } EXPORT_SYMBOL(fc_get_rport_loss_tmo); -void fc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) +void fc_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout) { if (timeout) rport->dev_loss_tmo = timeout + 5; diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index eade18b..4633ed1 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c @@ -56,7 +56,7 @@ static void fcdt_gnn_id_error(struct fc_disc_port *, struct fc_frame *); static void fc_disc_enter_reg_pn(struct fc_lport *lp); static void fc_disc_error(struct fc_lport *lp, struct fc_frame *fp); static void fc_lport_fill_dns_hdr(struct fc_lport *lp, struct fc_ct_hdr *ct, - u_int op, u_int req_size); + unsigned int op, unsigned int req_size); static void fc_disc_ns_resp(struct fc_seq *sp, struct fc_frame *fp, void *lp_arg); static void fc_disc_retry(struct fc_lport *lp); @@ -74,7 +74,7 @@ static void fc_disc_rscn_req(struct fc_seq *sp, struct fc_frame *fp, struct fc_els_rscn *rp; struct fc_els_rscn_page *pp; struct fc_seq_els_data rjt_data; - u_int len; + unsigned int len; int error; int redisc = 0; enum fc_els_rscn_ev_qual ev_qual; @@ -439,7 +439,7 @@ static void fc_disc_error(struct fc_lport *lp, struct fc_frame *fp) */ static void fcdt_retry(struct fc_lport *lp) { - u_long delay = FCDT_RETRY_DELAY; + unsigned long delay = FCDT_RETRY_DELAY; if (!lp->dns_disc_retry_count) delay /= 4; /* timeout faster first time */ @@ -571,7 +571,7 @@ static void fcdt_done(struct fc_lport *lp) struct fc_remote_port *rp; struct fc_remote_port *next; struct fc_remote_port *held; - u_int disc_ver; + unsigned int disc_ver; /* * Go through all remote_ports on the fabric which were not touched @@ -613,13 +613,13 @@ static void fcdt_done(struct fc_lport *lp) * Fill in request header. */ static void fcdt_fill_dns_hdr(struct fc_lport *lp, struct fc_ct_hdr *ct, - u_int op, u_int req_size) + unsigned int op, unsigned int req_size) { memset(ct, 0, sizeof(*ct) + req_size); ct->ct_rev = FC_CT_REV; ct->ct_fs_type = FC_FST_DIR; ct->ct_fs_subtype = FC_NS_SUBTYPE; - ct->ct_cmd = htons((u_int16_t) op); + ct->ct_cmd = htons((u16) op); } static void fcdt_gpn_ft_req(struct fc_lport *lp) @@ -696,7 +696,6 @@ static int fcdt_gpn_ft_parse(struct fc_lport *lp, void *buf, size_t len) size_t plen; size_t tlen; int error = 0; - struct fc_disc_port *dp; /* @@ -723,7 +722,7 @@ static int fcdt_gpn_ft_parse(struct fc_lport *lp, void *buf, size_t len) bp -= tlen; len += tlen; plen += tlen; - lp->fl_disc_buf_len = (u_char) plen; + lp->fl_disc_buf_len = (unsigned char) plen; if (plen == sizeof(*np)) lp->fl_disc_buf_len = 0; } @@ -764,7 +763,7 @@ static int fcdt_gpn_ft_parse(struct fc_lport *lp, void *buf, size_t len) if (error == 0 && len > 0 && len < sizeof(*np)) { if (np != &lp->fl_disc_buf) memcpy(&lp->fl_disc_buf, np, len); - lp->fl_disc_buf_len = (u_char) len; + lp->fl_disc_buf_len = (unsigned char) len; } else { lp->fl_disc_buf_len = 0; } @@ -794,9 +793,9 @@ static void fcdt_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp, struct fc_lport *lp = lp_arg; struct fc_ct_hdr *cp; struct fc_frame_header *fh; - u_int seq_cnt; + unsigned int seq_cnt; void *buf = NULL; - u_int len; + unsigned int len; int error; if (IS_ERR(fp)) { @@ -924,7 +923,7 @@ static void fcdt_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp, __be64 wwn; } *cp; fc_wwn_t wwpn; - u_int cmd; + unsigned int cmd; if (IS_ERR(fp)) { fcdt_gpn_id_error(rp, fp); @@ -1072,7 +1071,7 @@ static void fc_disc_enter_dns_stop(struct fc_lport *lp) */ static void fc_lport_fill_dns_hdr(struct fc_lport *lp, struct fc_ct_hdr *ct, - u_int op, u_int req_size) + unsigned int op, unsigned int req_size) { memset(ct, 0, sizeof(*ct) + req_size); ct->ct_rev = FC_CT_REV; @@ -1182,7 +1181,7 @@ static void fcdt_gnn_id_resp(struct fc_seq *sp, struct fc_frame *fp, struct fc_ct_hdr ct; __be64 wwn; } *cp; - u_int cmd; + unsigned int cmd; if (IS_ERR(fp)) { fcdt_gnn_id_error(dp, fp); diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 374cd5a..afce253 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c @@ -56,13 +56,13 @@ static int fc_exch_debug; * Sequence. */ struct fc_seq { - uint8_t seq_id; /* seq ID */ - uint8_t seq_active; /* active flag */ - uint16_t seq_s_stat; /* flags for sequence status block */ - uint16_t seq_cnt; /* frames sent so far on sequence */ + u8 seq_id; /* seq ID */ + u8 seq_active; /* active flag */ + u16 seq_s_stat; /* flags for sequence status block */ + u16 seq_cnt; /* frames sent so far on sequence */ atomic_t seq_refcnt; /* reference counter */ - uint32_t seq_f_ctl; /* F_CTL flags for frames */ - uint32_t seq_rec_data; /* FC-4 value for REC */ + u32 seq_f_ctl; /* F_CTL flags for frames */ + u32 seq_rec_data; /* FC-4 value for REC */ }; /* @@ -77,8 +77,8 @@ struct fc_exch { struct fc_exch_mgr *ex_mp; /* exchange manager */ fc_xid_t ex_xid; /* our exchange ID */ struct list_head ex_list; /* free or busy list linkage */ - spinlock_t ex_lock; /* lock covering exchange state */ - atomic_t ex_refcnt; /* reference counter */ + spinlock_t ex_lock; /* lock covering exchange state */ + atomic_t ex_refcnt; /* reference counter */ struct timer_list ex_timer; /* timer for upper level protocols */ struct fc_lport *lp; /* fc device instance */ fc_xid_t ex_ox_id; /* originator's exchange ID */ @@ -86,10 +86,10 @@ struct fc_exch { fc_fid_t ex_orig_fid; /* originator's FCID */ fc_fid_t ex_s_id; /* source ID */ fc_fid_t ex_d_id; /* destination ID */ - uint32_t ex_e_stat; /* exchange status for ESB */ - uint32_t ex_r_a_tov; /* r_a_tov from session (msec) */ - uint8_t ex_seq_id; /* next sequence ID to use */ - uint32_t ex_f_ctl; /* F_CTL flags for sequences */ + u32 ex_e_stat; /* exchange status for ESB */ + u32 ex_r_a_tov; /* r_a_tov from session (msec) */ + u8 ex_seq_id; /* next sequence ID to use */ + u32 ex_f_ctl; /* F_CTL flags for sequences */ enum fc_class ex_class; /* class of service */ struct fc_seq ex_seq; /* single sequence */ @@ -257,8 +257,8 @@ static char *fc_exch_rctl_names[] = FC_RCTL_NAMES_INIT; #define FC_TABLE_SIZE(x) (sizeof (x) / sizeof (x[0])) -static inline const char *fc_exch_name_lookup(u_int op, char **table, - u_int max_index) +static inline const char *fc_exch_name_lookup(unsigned int op, char **table, + unsigned int max_index) { const char *name = NULL; @@ -269,7 +269,7 @@ static inline const char *fc_exch_name_lookup(u_int op, char **table, return name; } -static const char *fc_exch_rctl_name(u_int op) +static const char *fc_exch_rctl_name(unsigned int op) { return fc_exch_name_lookup(op, fc_exch_rctl_names, FC_TABLE_SIZE(fc_exch_rctl_names)); @@ -298,7 +298,7 @@ inline void fc_seq_hold(struct fc_seq *sp) * By implication, any previously originated sequence on this exchange * is complete, and we reallocate the same sequence. */ -static struct fc_seq *fc_seq_alloc(struct fc_exch *ep, u_int8_t seq_id) +static struct fc_seq *fc_seq_alloc(struct fc_exch *ep, u8 seq_id) { struct fc_seq *sp; @@ -380,7 +380,8 @@ static void fc_exch_timeout(unsigned long ep_arg) /* * Internal version of fc_exch_timer_set - used with lock held. */ -static void fc_exch_timer_set_locked(struct fc_exch *ep, u_int timer_msec) +static void fc_exch_timer_set_locked(struct fc_exch *ep, + unsigned int timer_msec) { if (!timer_pending(&ep->ex_timer)) fc_exch_hold(ep); /* hold for timer */ @@ -394,7 +395,7 @@ static void fc_exch_timer_set_locked(struct fc_exch *ep, u_int timer_msec) * The timer is cancelled when it fires or when the exchange completes. * Returns non-zero if a timer couldn't be allocated. */ -void fc_exch_timer_set(struct fc_exch *ep, u_int timer_msec) +void fc_exch_timer_set(struct fc_exch *ep, unsigned int timer_msec) { spin_lock_bh(&ep->ex_lock); fc_exch_timer_set_locked(ep, timer_msec); @@ -498,7 +499,7 @@ static struct fc_exch *fc_exch_resp(struct fc_exch_mgr *mp, { struct fc_exch *ep; struct fc_frame_header *fh; - u_int16_t rx_id; + u16 rx_id; ep = mp->lp->tt.exch_get(mp->lp); if (ep) { @@ -552,7 +553,7 @@ fc_seq_lookup_recip(struct fc_exch_mgr *mp, struct fc_frame *fp) struct fc_exch *ep = NULL; struct fc_seq *sp = NULL; enum fc_pf_rjt_reason reject = FC_RJT_NONE; - u_int32_t f_ctl; + u32 f_ctl; fc_xid_t xid; f_ctl = ntoh24(fh->fh_f_ctl); @@ -660,7 +661,7 @@ static struct fc_seq *fc_seq_lookup_orig(struct fc_exch_mgr *mp, struct fc_frame_header *fh = fc_frame_header_get(fp); struct fc_exch *ep; struct fc_seq *sp = NULL; - u_int32_t f_ctl; + u32 f_ctl; fc_xid_t xid; f_ctl = ntoh24(fh->fh_f_ctl); @@ -735,7 +736,7 @@ int fc_seq_send(struct fc_lport *lp, struct fc_seq *sp, struct fc_exch *ep; struct fc_frame_header *fh; enum fc_class class; - u_int16_t fill = 0; + u16 fill = 0; int error; ep = fc_seq_exch(sp); @@ -849,7 +850,7 @@ static void fc_seq_send_ack(struct fc_seq *sp, const struct fc_frame *rx_fp) struct fc_frame_header *rx_fh; struct fc_frame_header *fh; struct fc_lport *lp; - u_int f_ctl; + unsigned int f_ctl; /* * Don't send ACKs for class 3. @@ -964,7 +965,7 @@ fc_exch_send_ba_rjt(struct fc_frame *rx_fp, enum fc_ba_rjt_reason reason, struct fc_frame_header *fh; struct fc_ba_rjt *rp; struct fc_lport *lp; - u_int f_ctl; + unsigned int f_ctl; lp = fr_dev(rx_fp); fp = fc_frame_alloc(lp, sizeof(*rp)); @@ -1026,7 +1027,7 @@ static void fc_exch_recv_req(struct fc_lport *lp, struct fc_exch_mgr *mp, struct fc_exch *ep = NULL; enum fc_sof sof; enum fc_eof eof; - u_int32_t f_ctl; + u32 f_ctl; enum fc_pf_rjt_reason reject; void (*resp)(struct fc_seq *, struct fc_frame *fp, void *arg); void *ex_arg; @@ -1091,7 +1092,7 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp) struct fc_seq *sp; struct fc_exch *ep; enum fc_sof sof; - u_int32_t f_ctl; + u32 f_ctl; void (*resp)(struct fc_seq *, struct fc_frame *fp, void *arg); void *ex_arg; @@ -1201,8 +1202,8 @@ static void fc_exch_abts_resp(struct fc_exch *ep, struct fc_frame *fp) { struct fc_frame_header *fh; struct fc_ba_acc *ap; - uint16_t low; - uint16_t high; + u16 low; + u16 high; fh = fc_frame_header_get(fp); if (fc_exch_debug) @@ -1253,7 +1254,7 @@ static void fc_exch_recv_bls(struct fc_exch_mgr *mp, struct fc_frame *fp) struct fc_frame_header *fh; struct fc_seq *sp; struct fc_exch *ep; - uint32_t f_ctl; + u32 f_ctl; fh = fc_frame_header_get(fp); f_ctl = ntoh24(fh->fh_f_ctl); @@ -1585,7 +1586,7 @@ static void fc_exch_rrq(struct fc_exch *ep) */ static void fc_exch_rrq_resp(struct fc_seq *sp, struct fc_frame *fp, void *arg) { - u_int op; + unsigned int op; if (IS_ERR(fp)) return; @@ -1888,7 +1889,7 @@ struct fc_seq *fc_exch_seq_send(struct fc_lport *lp, struct fc_exch *ep; struct fc_seq *sp = NULL; struct fc_frame_header *fh; - u_int16_t fill; + u16 fill; ep = lp->tt.exch_get(lp); if (!ep) { @@ -1960,7 +1961,7 @@ void fc_exch_recv(struct fc_lport *lp, struct fc_exch_mgr *mp, struct fc_frame *fp) { struct fc_frame_header *fh = fc_frame_header_get(fp); - u_int32_t f_ctl; + u32 f_ctl; if (!lp) { FC_DBG("fcs_local_port_config needed before receiving"); diff --git a/drivers/scsi/libfc/fc_frame.c b/drivers/scsi/libfc/fc_frame.c index e101eeb..d89a07a 100644 --- a/drivers/scsi/libfc/fc_frame.c +++ b/drivers/scsi/libfc/fc_frame.c @@ -36,20 +36,20 @@ /* * Check the CRC in a frame. */ -u_int32_t fc_frame_crc_check(struct fc_frame *fp) +u32 fc_frame_crc_check(struct fc_frame *fp) { - u_int32_t crc; - u_int32_t error; - const u_int8_t *bp; - u_int len; + u32 crc; + u32 error; + const u8 *bp; + unsigned int len; WARN_ON(!fc_frame_is_linear(fp)); fr_flags(fp) &= ~FCPHF_CRC_UNCHECKED; len = (fr_len(fp) + 3) & ~3; /* round up length to include fill */ - bp = (const u_int8_t *) fr_hdr(fp); + bp = (const u8 *) fr_hdr(fp); crc = ~crc32(~0, bp, len); - error = crc ^ *(u_int32_t *) (bp + len); - return (error); + error = crc ^ *(u32 *) (bp + len); + return error; } EXPORT_SYMBOL(fc_frame_crc_check); @@ -62,7 +62,7 @@ struct fc_frame *__fc_frame_alloc(size_t len) struct fc_frame *fp; struct sk_buff *skb; - WARN_ON((len % sizeof(uint32_t)) != 0); + WARN_ON((len % sizeof(u32)) != 0); len += sizeof(struct fc_frame_header); skb = dev_alloc_skb(len + FC_FRAME_HEADROOM + FC_FRAME_TAILROOM); if (!skb) diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 2ded38e..9a06704 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c @@ -243,7 +243,7 @@ static void fc_lport_error(struct fc_lport *lp, struct fc_frame *fp) */ static void fc_lport_flogi_fill(struct fc_lport *lp, - struct fc_els_flogi *flogi, u_int op) + struct fc_els_flogi *flogi, unsigned int op) { struct fc_els_csp *sp; struct fc_els_cssp *cp; @@ -256,7 +256,7 @@ fc_lport_flogi_fill(struct fc_lport *lp, sp->sp_hi_ver = 0x20; sp->sp_lo_ver = 0x20; sp->sp_bb_cred = htons(10); /* this gets set by gateway */ - sp->sp_bb_data = htons((u_int16_t) lp->mfs); + sp->sp_bb_data = htons((u16) lp->mfs); cp = &flogi->fl_cssp[3 - 1]; /* class 3 parameters */ cp->cp_class = htons(FC_CPC_VALID | FC_CPC_SEQ); if (op != ELS_FLOGI) { @@ -265,7 +265,7 @@ fc_lport_flogi_fill(struct fc_lport *lp, sp->sp_rel_off = htons(0x1f); sp->sp_e_d_tov = htonl(lp->fl_e_d_tov); - cp->cp_rdfs = htons((u_int16_t) lp->mfs); + cp->cp_rdfs = htons((u16) lp->mfs); cp->cp_con_seq = htons(255); cp->cp_open_seq = 1; } @@ -276,18 +276,16 @@ fc_lport_flogi_fill(struct fc_lport *lp, * Save parameters of remote switch. Finish exchange. */ static void -fc_lport_flogi_resp(struct fc_seq *sp, - struct fc_frame *fp, - void *lp_arg) +fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, void *lp_arg) { struct fc_lport *lp = lp_arg; struct fc_frame_header *fh; struct fc_els_flogi *flp; fc_fid_t did; - u_int16_t csp_flags; - u_int r_a_tov; - u_int e_d_tov; - uint16_t mfs; + u16 csp_flags; + unsigned int r_a_tov; + unsigned int e_d_tov; + u16 mfs; if (IS_ERR(fp)) goto out; @@ -460,7 +458,7 @@ void fc_lport_enter_flogi(struct fc_lport *lp) } static void fc_lport_logo_resp(struct fc_seq *sp, struct fc_frame *fp, - void *lp_arg) + void *lp_arg) { struct fc_lport *lp = lp_arg; @@ -656,7 +654,7 @@ static void fc_lport_echo_req(struct fc_seq *sp, struct fc_frame *in_fp, { struct fc_lport *lp = lp_arg; struct fc_frame *fp; - u_int len; + unsigned int len; void *pp; void *dp; u32 f_ctl; @@ -696,7 +694,7 @@ static void fc_lport_rnid_req(struct fc_seq *sp, struct fc_frame *in_fp, struct fc_els_rnid_gen gen; } *rp; struct fc_seq_els_data rjt_data; - u_int8_t fmt; + u8 fmt; size_t len; u32 f_ctl; @@ -972,7 +970,7 @@ EXPORT_SYMBOL(fc_lport_destroy); int fc_set_mfs(struct fc_lport *lp, u32 mfs) { - u_int old_mfs; + unsigned int old_mfs; int rc = -1; old_mfs = lp->mfs; @@ -995,8 +993,7 @@ int fc_set_mfs(struct fc_lport *lp, u32 mfs) } EXPORT_SYMBOL(fc_set_mfs); -int fc_lport_init(struct fc_lport *lp, - struct fc_transport_template *tmpl) +int fc_lport_init(struct fc_lport *lp, struct fc_transport_template *tmpl) { // if (!lp->tt.lp_event) // lp->tt.lp_event = fc_lp_event; diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index 678617b..cf394a9 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c @@ -257,10 +257,10 @@ static inline void fc_sess_unlock(struct fc_remote_port *rp) spin_unlock_bh(&rp->fs_lock); } -static -u_int fc_lport_get_payload_size(struct fc_els_flogi *flp, u_int maxval) +static unsigned int +fc_lport_get_payload_size(struct fc_els_flogi *flp, unsigned int maxval) { - u_int mfs; + unsigned int mfs; /* * Get max payload from the common service parameters and the @@ -280,7 +280,7 @@ u_int fc_lport_get_payload_size(struct fc_els_flogi *flp, u_int maxval) */ static void fc_lport_plogi_fill(struct fc_lport *lp, - struct fc_els_flogi *flogi, u_int op) + struct fc_els_flogi *flogi, unsigned int op) { struct fc_els_csp *sp; struct fc_els_cssp *cp; @@ -294,7 +294,7 @@ fc_lport_plogi_fill(struct fc_lport *lp, sp->sp_hi_ver = 0x20; sp->sp_lo_ver = 0x20; sp->sp_bb_cred = htons(10); /* this gets set by gateway */ - sp->sp_bb_data = htons((u_int16_t) lp->mfs); + sp->sp_bb_data = htons((u16) lp->mfs); cp = &flogi->fl_cssp[3 - 1]; /* class 3 parameters */ cp->cp_class = htons(FC_CPC_VALID | FC_CPC_SEQ); if (op != ELS_FLOGI) { @@ -303,7 +303,7 @@ fc_lport_plogi_fill(struct fc_lport *lp, sp->sp_rel_off = htons(0x1f); sp->sp_e_d_tov = htonl(lp->fl_e_d_tov); - cp->cp_rdfs = htons((u_int16_t) lp->mfs); + cp->cp_rdfs = htons((u16) lp->mfs); cp->cp_con_seq = htons(255); cp->cp_open_seq = 1; } @@ -692,9 +692,9 @@ static void fc_rport_plogi_recv_resp(struct fc_seq *sp, struct fc_frame *fp, struct fc_els_ls_rjt *rjp; struct fc_els_flogi *plp; fc_wwn_t wwpn, wwnn; - u_int tov; - uint16_t csp_seq; - uint16_t cssp_seq; + unsigned int tov; + u16 csp_seq; + u16 cssp_seq; u8 op; struct fc_remote_port *rp = rp_arg; @@ -908,8 +908,8 @@ static void fc_rport_els_rtv_resp(struct fc_seq *sp, struct fc_frame *fp, op = fc_frame_payload_op(fp); if (op == ELS_LS_ACC) { struct fc_els_rtv_acc *rtv; - uint32_t toq; - uint32_t tov; + u32 toq; + u32 tov; rtv = fc_frame_payload_get(fp, sizeof(*rtv)); if (rtv) { @@ -1160,7 +1160,7 @@ static void fc_rport_recv_plogi_req(struct fc_remote_port *rp, /* * Get session payload size from incoming PLOGI. */ - rp->fs_max_payload = (uint16_t) + rp->fs_max_payload = (u16) fc_lport_get_payload_size(pl, lp->mfs); fc_frame_free(rx_fp); pl = fc_frame_payload_get(fp, sizeof(*pl)); @@ -1198,8 +1198,8 @@ static void fc_rport_recv_prli_req(struct fc_remote_port *rp, } *pp; struct fc_els_spp *rspp; /* request service param page */ struct fc_els_spp *spp; /* response spp */ - u_int len; - u_int plen; + unsigned int len; + unsigned int plen; enum fc_els_rjt_reason reason = ELS_RJT_UNAB; enum fc_els_rjt_explan explan = ELS_EXPL_NONE; enum fc_els_spp_resp resp; diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c index 8c23082..66ca996 100644 --- a/drivers/scsi/libfc/fc_scsi.c +++ b/drivers/scsi/libfc/fc_scsi.c @@ -53,10 +53,10 @@ struct fc_scsi_pkt { * housekeeping stuff */ struct fc_lport *lp; /* handle to hba struct */ - uint16_t state; /* scsi_pkt state state */ - uint16_t tgt_flags; /* target flags */ + u16 state; /* scsi_pkt state state */ + u16 tgt_flags; /* target flags */ atomic_t ref_cnt; /* only used byr REC ELS */ - uint32_t idx; /* host given value */ + u32 idx; /* host given value */ /* * SCSI I/O related stuff */ @@ -75,7 +75,7 @@ struct fc_scsi_pkt { /* * scsi cmd and data transfer information */ - uint32_t data_len; + u32 data_len; /* * transport related veriables */ @@ -87,13 +87,13 @@ struct fc_scsi_pkt { /* * scsi/fcp return status */ - uint32_t io_status; /* SCSI result upper 24 bits */ - uint8_t cdb_status; - uint8_t status_code; /* OPENFC I/O status */ + u32 io_status; /* SCSI result upper 24 bits */ + u8 cdb_status; + u8 status_code; /* OPENFC I/O status */ /* bit 3 Underrun bit 2: overrun */ - uint8_t scsi_comp_flags; - uint32_t req_flags; /* bit 0: read bit:1 write */ - uint32_t scsi_resid; /* residule length */ + u8 scsi_comp_flags; + u32 req_flags; /* bit 0: read bit:1 write */ + u32 scsi_resid; /* residule length */ /* * FCS related data struct */ @@ -102,7 +102,7 @@ struct fc_scsi_pkt { /* * Error Processing */ - uint8_t recov_retry; /* count of recovery retries */ + u8 recov_retry; /* count of recovery retries */ struct fc_seq *recov_seq; /* sequence for REC or SRR */ }; @@ -981,14 +981,14 @@ static int fc_scsi_send_cmd(struct fc_scsi_pkt *fsp) lp->tt.seq_hold(sp); fsp->seq_ptr = sp; fsp->max_payload = rp->fs_max_payload; - fsp->timer.data = (ulong)fsp; - fsp->timer.function = (void (*)(ulong))fc_scsi_timeout; + fsp->timer.data = (unsigned long)fsp; + fsp->timer.function = (void (*)(unsigned long))fc_scsi_timeout; fc_scsi_timer_set(fsp, (fsp->tgt_flags & FC_TGT_REC_SUPPORTED) ? FC_SCSI_REC_TOV : FC_SCSI_ER_TIMEOUT); return 0; retry: - fsp->timer.data = (ulong)fsp; - fsp->timer.function = (void (*)(ulong))fc_scsi_send_cmd; + fsp->timer.data = (unsigned long)fsp; + fsp->timer.function = (void (*)(unsigned long))fc_scsi_send_cmd; fc_scsi_timer_set(fsp, FC_SCSI_REC_TOV); return 0; } @@ -1095,7 +1095,7 @@ static void fc_lun_reset_send(struct fc_scsi_pkt *fsp) */ fc_frame_free(fp); retry: - fsp->timer.function = (void (*)(ulong))fc_lun_reset_send; + fsp->timer.function = (void (*)(unsigned long))fc_lun_reset_send; fc_scsi_timer_set(fsp, FC_SCSI_REC_TOV); } @@ -1830,7 +1830,7 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) sp->tgt_flags = rp->tgt_flags; init_timer(&sp->timer); - sp->timer.data = (ulong)sp; + sp->timer.data = (unsigned long)sp; /* * send it to the lower layer diff --git a/include/scsi/fc/fc_els.h b/include/scsi/fc/fc_els.h index 8130b14..e90ddbf 100644 --- a/include/scsi/fc/fc_els.h +++ b/include/scsi/fc/fc_els.h @@ -278,9 +278,9 @@ struct fc_els_cssp { __be16 cp_rdfs; /* receive data field size */ __be16 cp_con_seq; /* concurrent sequences */ __be16 cp_ee_cred; /* N-port end-to-end credit */ - u_int8_t _cp_resv1; /* reserved */ - u_int8_t cp_open_seq; /* open sequences per exchange */ - u_int8_t _cp_resv2[2]; /* reserved */ + __u8 cp_resv1; /* reserved */ + __u8 cp_open_seq; /* open sequences per exchange */ + __u8 _cp_resv2[2]; /* reserved */ }; /* diff --git a/include/scsi/fc/fc_encaps.h b/include/scsi/fc/fc_encaps.h index a5116c6..f910708 100644 --- a/include/scsi/fc/fc_encaps.h +++ b/include/scsi/fc/fc_encaps.h @@ -27,116 +27,112 @@ * The minimum frame length value in bytes is (32 + 24 + 4 + 4) * 4 = 64. * The maximum frame length value in bytes is (32 + 24 + 2112 + 4 + 4) = 2172. */ -#define FC_ENCAPS_MIN_FRAME_LEN 64 /* min frame len (bytes) (see above) */ -#define FC_ENCAPS_MAX_FRAME_LEN (FC_ENCAPS_MIN_FRAME_LEN + FC_MAX_PAYLOAD) +#define FC_ENCAPS_MIN_FRAME_LEN 64 /* min frame len (bytes) (see above) */ +#define FC_ENCAPS_MAX_FRAME_LEN (FC_ENCAPS_MIN_FRAME_LEN + FC_MAX_PAYLOAD) #define FC_ENCAPS_VER 1 /* current version number */ struct fc_encaps_hdr { - __u8 fc_proto; /* protocol number */ - __u8 fc_ver; /* version of encapsulation */ - __u8 fc_proto_n; /* ones complement of protocol */ - __u8 fc_ver_n; /* ones complement of version */ + __u8 fc_proto; /* protocol number */ + __u8 fc_ver; /* version of encapsulation */ + __u8 fc_proto_n; /* ones complement of protocol */ + __u8 fc_ver_n; /* ones complement of version */ - u_char fc_proto_data[8]; /* protocol specific data */ + unsigned char fc_proto_data[8]; /* protocol specific data */ - __be16 fc_len_flags; /* 10-bit length/4 w/ 6 flag bits */ - __be16 fc_len_flags_n; /* ones complement of length / flags */ + __be16 fc_len_flags; /* 10-bit length/4 w/ 6 flag bits */ + __be16 fc_len_flags_n; /* ones complement of length / flags */ - /* - * Offset 0x10 - */ - __be32 fc_time[2]; /* time stamp: seconds and fraction */ - __be32 fc_crc; /* CRC */ - __be32 fc_sof; /* start of frame (see FC_SOF below) */ + /* + * Offset 0x10 + */ + __be32 fc_time[2]; /* time stamp: seconds and fraction */ + __be32 fc_crc; /* CRC */ + __be32 fc_sof; /* start of frame (see FC_SOF below) */ - /* 0x20 - FC frame content followed by EOF word */ + /* 0x20 - FC frame content followed by EOF word */ }; -#define FCIP_ENCAPS_HDR_LEN 0x20 /* expected length for asserts */ +#define FCIP_ENCAPS_HDR_LEN 0x20 /* expected length for asserts */ /* * Macro's for making redundant copies of EOF and SOF. */ -#define FC_XY(x, y) ((((x) & 0xff) << 8) | ((y) & 0xff)) -#define FC_XYXY(x, y) ((FCIP_XY(x, y) << 16) | FCIP_XY(x, y)) -#define FC_XYNN(x, y) (FCIP_XYXY(x, y) ^ 0xffff) +#define FC_XY(x, y) ((((x) & 0xff) << 8) | ((y) & 0xff)) +#define FC_XYXY(x, y) ((FCIP_XY(x, y) << 16) | FCIP_XY(x, y)) +#define FC_XYNN(x, y) (FCIP_XYXY(x, y) ^ 0xffff) -#define FC_SOF_ENCODE(n) FC_XYNN(n, n) -#define FC_EOF_ENCODE(n) FC_XYNN(n, n) +#define FC_SOF_ENCODE(n) FC_XYNN(n, n) +#define FC_EOF_ENCODE(n) FC_XYNN(n, n) /* * SOF / EOF bytes. */ enum fc_sof { - FC_SOF_F = 0x28, /* fabric */ - FC_SOF_I4 = 0x29, /* initiate class 4 */ - FC_SOF_I2 = 0x2d, /* initiate class 2 */ - FC_SOF_I3 = 0x2e, /* initiate class 3 */ - FC_SOF_N4 = 0x31, /* normal class 4 */ - FC_SOF_N2 = 0x35, /* normal class 2 */ - FC_SOF_N3 = 0x36, /* normal class 3 */ - FC_SOF_C4 = 0x39, /* activate class 4 */ + FC_SOF_F = 0x28, /* fabric */ + FC_SOF_I4 = 0x29, /* initiate class 4 */ + FC_SOF_I2 = 0x2d, /* initiate class 2 */ + FC_SOF_I3 = 0x2e, /* initiate class 3 */ + FC_SOF_N4 = 0x31, /* normal class 4 */ + FC_SOF_N2 = 0x35, /* normal class 2 */ + FC_SOF_N3 = 0x36, /* normal class 3 */ + FC_SOF_C4 = 0x39, /* activate class 4 */ } __attribute__((packed)); enum fc_eof { - FC_EOF_N = 0x41, /* normal (not last frame of seq) */ - FC_EOF_T = 0x42, /* terminate (last frame of sequence) */ - FC_EOF_RT = 0x44, - FC_EOF_DT = 0x46, /* disconnect-terminate class-1 */ - FC_EOF_NI = 0x49, /* normal-invalid */ - FC_EOF_DTI = 0x4e, /* disconnect-terminate-invalid */ - FC_EOF_RTI = 0x4f, - FC_EOF_A = 0x50, /* abort */ + FC_EOF_N = 0x41, /* normal (not last frame of seq) */ + FC_EOF_T = 0x42, /* terminate (last frame of sequence) */ + FC_EOF_RT = 0x44, + FC_EOF_DT = 0x46, /* disconnect-terminate class-1 */ + FC_EOF_NI = 0x49, /* normal-invalid */ + FC_EOF_DTI = 0x4e, /* disconnect-terminate-invalid */ + FC_EOF_RTI = 0x4f, + FC_EOF_A = 0x50, /* abort */ } __attribute__((packed)); -#define FC_SOF_CLASS_MASK 0x06 /* mask for class of service in SOF */ +#define FC_SOF_CLASS_MASK 0x06 /* mask for class of service in SOF */ /* * Define classes in terms of the SOF code (initial). */ enum fc_class { - FC_CLASS_NONE = 0, /* software value indicating no class */ - FC_CLASS_2 = FC_SOF_I2, - FC_CLASS_3 = FC_SOF_I3, - FC_CLASS_4 = FC_SOF_I4, - FC_CLASS_F = FC_SOF_F, -} __attribute__((packed)); + FC_CLASS_NONE = 0, /* software value indicating no class */ + FC_CLASS_2 = FC_SOF_I2, + FC_CLASS_3 = FC_SOF_I3, + FC_CLASS_4 = FC_SOF_I4, + FC_CLASS_F = FC_SOF_F, +}; /* * Determine whether SOF code indicates the need for a BLS ACK. */ -static inline int -fc_sof_needs_ack(enum fc_sof sof) +static inline int fc_sof_needs_ack(enum fc_sof sof) { - return ((~sof) & 0x02); /* true for class 1, 2, 4, 6, or F */ + return ((~sof) & 0x02); /* true for class 1, 2, 4, 6, or F */ } /* * Given an fc_class, return the normal (non-initial) SOF value. */ -static inline enum fc_sof -fc_sof_normal(enum fc_class class) +static inline enum fc_sof fc_sof_normal(enum fc_class class) { - return (class + FC_SOF_N3 - FC_SOF_I3); /* diff is always 8 */ + return (class + FC_SOF_N3 - FC_SOF_I3); /* diff is always 8 */ } /* * Compute class from SOF value. */ -static inline enum fc_class -fc_sof_class(enum fc_sof sof) +static inline enum fc_class fc_sof_class(enum fc_sof sof) { - return ((sof & 0x7) | FC_SOF_F); + return ((sof & 0x7) | FC_SOF_F); } /* * Determine whether SOF is for the initial frame of a sequence. */ -static inline int -fc_sof_is_init(enum fc_sof sof) +static inline int fc_sof_is_init(enum fc_sof sof) { - return (sof < 0x30); + return (sof < 0x30); } #endif /* _FC_ENCAPS_H_ */ diff --git a/include/scsi/fc/fc_fc2.h b/include/scsi/fc/fc_fc2.h index 38a2ab5..cff8a8c 100644 --- a/include/scsi/fc/fc_fc2.h +++ b/include/scsi/fc/fc_fc2.h @@ -34,18 +34,18 @@ * Note that the fields aren't all naturally aligned. */ struct fc_ssb { - u_int8_t ssb_seq_id; /* sequence ID */ - u_int8_t _ssb_resvd; - u_int16_t ssb_low_seq_cnt; /* lowest SEQ_CNT */ - - u_int16_t ssb_high_seq_cnt; /* highest SEQ_CNT */ - u_int16_t ssb_s_stat; /* sequence status flags */ - - u_int16_t ssb_err_seq_cnt; /* error SEQ_CNT */ - u_int8_t ssb_fh_cs_ctl; /* frame header CS_CTL */ - u_int16_t ssb_fh_ox_id; /* frame header OX_ID */ - u_int16_t ssb_rx_id; /* responder's exchange ID */ - u_int8_t _ssb_resvd2[2]; + __u8 ssb_seq_id; /* sequence ID */ + __u8 _ssb_resvd; + __be16 ssb_low_seq_cnt; /* lowest SEQ_CNT */ + + __be16 ssb_high_seq_cnt; /* highest SEQ_CNT */ + __be16 ssb_s_stat; /* sequence status flags */ + + __be16 ssb_err_seq_cnt; /* error SEQ_CNT */ + __u8 ssb_fh_cs_ctl; /* frame header CS_CTL */ + __be16 ssb_fh_ox_id; /* frame header OX_ID */ + __be16 ssb_rx_id; /* responder's exchange ID */ + __u8 _ssb_resvd2[2]; } PACKED; /* @@ -83,16 +83,16 @@ struct fc_ssb { * Note that the fields aren't all naturally aligned. */ struct fc_esb { - u_int8_t esb_cs_ctl; /* CS_CTL for frame header */ - u_int16_t esb_ox_id; /* originator exchange ID */ - u_int16_t esb_rx_id; /* responder exchange ID */ - u_int32_t esb_orig_fid; /* fabric ID of originator */ - u_int32_t esb_resp_fid; /* fabric ID of responder */ - u_int32_t esb_e_stat; /* status */ - u_int8_t _esb_resvd[4]; - u_int8_t esb_service_params[112]; /* TBD */ - u_int8_t esb_seq_status[8]; /* sequence statuses, 8 bytes each */ -} PACKED; + __u8 esb_cs_ctl; /* CS_CTL for frame header */ + __be16 esb_ox_id; /* originator exchange ID */ + __be16 esb_rx_id; /* responder exchange ID */ + __be32 esb_orig_fid; /* fabric ID of originator */ + __be32 esb_resp_fid; /* fabric ID of responder */ + __be32 esb_e_stat; /* status */ + __u8 _esb_resvd[4]; + __u8 esb_service_params[112]; /* TBD */ + __u8 esb_seq_status[8]; /* sequence statuses, 8 bytes each */ +} __attribute__((packed));; /* diff --git a/include/scsi/libfc/fc_frame.h b/include/scsi/libfc/fc_frame.h index 1efb3d0..1aa303e 100644 --- a/include/scsi/libfc/fc_frame.h +++ b/include/scsi/libfc/fc_frame.h @@ -62,7 +62,7 @@ struct fcoe_rcv_info { struct fc_seq *fr_seq; /* for use with exchange manager */ enum fc_sof fr_sof; /* start of frame delimiter */ enum fc_eof fr_eof; /* end of frame delimiter */ - u_int8_t fr_flags; /* flags - see below */ + u8 fr_flags; /* flags - see below */ }; /* @@ -224,7 +224,7 @@ fc_frame_set_offset(struct fc_frame *fp, u_int32_t offset) * The CRC immediately follows the last data item *AFTER* the length. * The return value is zero if the CRC matches. */ -u_int32_t fc_frame_crc_check(struct fc_frame *); +u32 fc_frame_crc_check(struct fc_frame *); /* * Check for leaks. diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h index b5db8ea..3c61b87 100644 --- a/include/scsi/libfc/libfc.h +++ b/include/scsi/libfc/libfc.h @@ -104,8 +104,8 @@ struct fc_exch_mgr; * it cannot be declared as uint64_t. */ typedef unsigned long long fc_wwn_t; /* world-wide name */ -typedef uint32_t fc_fid_t; /* fabric address */ -typedef uint16_t fc_xid_t; /* exchange ID */ +typedef u32 fc_fid_t; /* fabric address */ +typedef u16 fc_xid_t; /* exchange ID */ enum ofc_io_speed { OFC_SPEED_UNK = 0, @@ -149,31 +149,31 @@ enum fc_sess_state { * Fibre Channel information about remote N port. */ struct fc_remote_port { - struct list_head rp_list; /* list under fc_virt_fab */ - atomic_t rp_refcnt; /* reference count */ - u_int rp_disc_ver; /* discovery instance */ - u_int rp_fcp_parm; /* remote FCP service parameters */ - struct fc_rport *rport; - uint16_t tgt_flags; - struct hlist_node rp_fid_hash_link; + struct list_head rp_list; /* list under fc_virt_fab */ + atomic_t rp_refcnt; /* reference count */ + unsigned int rp_disc_ver; /* discovery instance */ + unsigned int rp_fcp_parm; /* remote FCP service parameters */ + struct fc_rport *rport; + u16 tgt_flags; + struct hlist_node rp_fid_hash_link; /* * For now, there's just one session per remote port. * Eventually, for multipathing, there will be more. */ - u_char rp_sess_ready; /* session ready to be used */ - int dns_lookup_count; /* number of attempted lookups */ + unsigned char rp_sess_ready; /* session ready to be used */ + int dns_lookup_count; /* number of attempted lookups */ /* fc_sess fields */ - struct fc_lport *local_port; /* local port (aka LIF) */ - enum fc_sess_state fs_state; /* session state */ - uint fs_retries; /* retry count in current state */ - struct timer_list fs_timer; /* retry timer */ - uint16_t fs_max_payload; /* max payload size in bytes */ - uint16_t fs_max_seq; /* max concurrent sequences */ - uint fs_e_d_tov; /* negotiated e_d_tov (msec) */ - uint fs_r_a_tov; /* received r_a_tov (msec) */ - spinlock_t fs_lock; /* lock on state changes */ + struct fc_lport *local_port; /* local port (aka LIF) */ + enum fc_sess_state fs_state; /* session state */ + unsigned int fs_retries; /* retry count in current state */ + struct timer_list fs_timer; /* retry timer */ + u16 fs_max_payload; /* max payload size in bytes */ + u16 fs_max_seq; /* max concurrent sequences */ + unsigned int fs_e_d_tov; /* negotiated e_d_tov (msec) */ + unsigned int fs_r_a_tov; /* received r_a_tov (msec) */ + spinlock_t fs_lock; /* lock on state changes */ }; static inline void fc_rport_set_name(struct fc_rport *rport, fc_wwn_t wwpn, @@ -187,37 +187,37 @@ static inline void fc_rport_set_name(struct fc_rport *rport, fc_wwn_t wwpn, * device specific information */ struct fc_drv_info { - char model[64]; - char vendor[64]; - char sn[64]; - char model_desc[256]; - char hw_version[256]; - char fw_version[256]; - char opt_rom_version[256]; - char drv_version[128]; - char drv_name[128]; + char model[64]; + char vendor[64]; + char sn[64]; + char model_desc[256]; + char hw_version[256]; + char fw_version[256]; + char opt_rom_version[256]; + char drv_version[128]; + char drv_name[128]; }; /* * fcoe stats structure */ struct fcoe_dev_stats { - uint64_t SecondsSinceLastReset; - uint64_t TxFrames; - uint64_t TxWords; - uint64_t RxFrames; - uint64_t RxWords; - uint64_t ErrorFrames; - uint64_t DumpedFrames; - uint64_t LinkFailureCount; - uint64_t LossOfSignalCount; - uint64_t InvalidTxWordCount; - uint64_t InvalidCRCCount; - uint64_t InputRequests; - uint64_t OutputRequests; - uint64_t ControlRequests; - uint64_t InputMegabytes; - uint64_t OutputMegabytes; + u64 SecondsSinceLastReset; + u64 TxFrames; + u64 TxWords; + u64 RxFrames; + u64 RxWords; + u64 ErrorFrames; + u64 DumpedFrames; + u64 LinkFailureCount; + u64 LossOfSignalCount; + u64 InvalidTxWordCount; + u64 InvalidCRCCount; + u64 InputRequests; + u64 OutputRequests; + u64 ControlRequests; + u64 InputMegabytes; + u64 OutputMegabytes; }; /* @@ -306,7 +306,7 @@ struct fc_transport_template { void (*resp)(struct fc_seq *, struct fc_frame *fp, void *arg), - void *resp_arg, u_int timer_msec, + void *resp_arg, unsigned int timer_msec, fc_fid_t sid, fc_fid_t did, u32 f_ctl); /* @@ -399,13 +399,13 @@ struct fc_transport_template { void (*rport_closed)(struct fc_lport *, struct fc_rport *); struct fc_rport *(*rport_lookup_create)(struct fc_lport *, - struct fc_rport_identifiers *); + struct fc_rport_identifiers *); void (*rport_hold)(struct fc_remote_port *); void (*rport_release)(struct fc_remote_port *); struct fc_rport *(*rport_lookup)(const struct fc_lport *lp, - fc_fid_t fid); + fc_fid_t fid); void (*sess_reset)(struct fc_remote_port *); @@ -444,63 +444,63 @@ struct fc_lport { struct list_head list; /* Associations */ - struct Scsi_Host *host; - struct fc_exch_mgr *emp; - struct fc_rport *dns_rp; - struct fc_rport *ptp_rp; - struct list_head rport_list; - void *scsi_priv; + struct Scsi_Host *host; + struct fc_exch_mgr *emp; + struct fc_rport *dns_rp; + struct fc_rport *ptp_rp; + struct list_head rport_list; + void *scsi_priv; /* Operational Information */ struct fc_transport_template tt; - uint16_t status; - atomic_t fcs_status; - uint8_t dns_disc_done; - enum fc_lport_state state; - ulong boot_time; + u16 status; + atomic_t fcs_status; + u8 dns_disc_done; + enum fc_lport_state state; + unsigned long boot_time; struct fc_host_statistics host_stats; - struct fcoe_dev_stats *dev_stats[NR_CPUS]; - - fc_wwn_t wwpn; - fc_wwn_t wwnn; - fc_fid_t fid; - uint8_t retry_count; - uint8_t logon_reqested; - u_int dns_disc_ver; - u_char dns_disc_retry_count; - u_char dns_delay; - u_char fl_disc_in_prog; - u_char fl_disc_req; - u_short fl_disc_seq_cnt; - u_char fl_disc_buf_len; + struct fcoe_dev_stats *dev_stats[NR_CPUS]; + + fc_wwn_t wwpn; + fc_wwn_t wwnn; + fc_fid_t fid; + u8 retry_count; + u8 logon_reqested; + unsigned int dns_disc_ver; + unsigned char dns_disc_retry_count; + unsigned char dns_delay; + unsigned char fl_disc_in_prog; + unsigned char fl_disc_req; + unsigned short fl_disc_seq_cnt; + unsigned char fl_disc_buf_len; /* Capabilities */ - char ifname[IFNAMSIZ]; - uint32_t capabilities; - ulong qdepth; - u32 mfs; /* max FC payload size */ - u_int service_params; - u_int fl_e_d_tov; - u_int fl_r_a_tov; - uint8_t fl_retry_limit; - int link_status; - u16 link_speed; - u16 link_supported_speeds; - struct fc_ns_fts fl_ns_fts; /* FC-4 type masks */ - struct fc_els_rnid_gen fl_rnid_gen; /* RNID information */ - + char ifname[IFNAMSIZ]; + u32 capabilities; + unsigned long qdepth; + u32 mfs; /* max FC payload size */ + unsigned int service_params; + unsigned int fl_e_d_tov; + unsigned int fl_r_a_tov; + u8 fl_retry_limit; + int link_status; + u16 link_speed; + u16 link_supported_speeds; + struct fc_ns_fts fl_ns_fts; /* FC-4 type masks */ + struct fc_els_rnid_gen fl_rnid_gen; /* RNID information */ + /* Locks */ - spinlock_t fl_lock; /* serializes state changes */ - spinlock_t rp_lock; /* lock for list of fc_rports */ + spinlock_t fl_lock; /* serializes state changes */ + spinlock_t rp_lock; /* lock for list of fc_rports */ /* Miscellaneous */ - struct fc_gpn_ft_resp fl_disc_buf; /* partial name buffer */ - struct timer_list fl_timer; /* timer for state events */ - struct timer_list fl_disc_timer; /* timer for continuing */ + struct fc_gpn_ft_resp fl_disc_buf; /* partial name buffer */ + struct timer_list fl_timer; /* timer for state events */ + struct timer_list fl_disc_timer; /* timer for continuing */ - void *drv_priv; - struct fc_drv_info drv_info; + void *drv_priv; + struct fc_drv_info drv_info; }; /** @@ -828,7 +828,7 @@ void fc_get_host_speed(struct Scsi_Host *shost); void fc_get_host_port_type(struct Scsi_Host *shost); void fc_get_host_fabric_name(struct Scsi_Host *shost); void fc_get_rport_loss_tmo(struct fc_rport *rport); -void fc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); +void fc_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout); struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *); #endif /* _LIBFC_H_ */ -- 1.5.4.1