aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfad_im.c
diff options
context:
space:
mode:
authorJing Huang <huangj@brocade.com>2010-10-18 20:14:01 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-10-25 17:25:35 -0400
commite0a08a30c9451333c9c4a8981fbfccc80b87ce78 (patch)
tree6ec318b2d48eb6206a1e584e78873044b0712b4a /drivers/scsi/bfa/bfad_im.c
parent5344026065f79b102fcc44bc6332f856a111962a (diff)
[SCSI] bfa: fix frame size over 1024 compile warning
Fix compile warning for frame size over 1024 in gcc 4.4. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfad_im.c')
-rw-r--r--drivers/scsi/bfa/bfad_im.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index 236922bc9e40..7a6f48b277c2 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -915,12 +915,16 @@ bfad_im_slave_alloc(struct scsi_device *sdev)
915static u32 915static u32
916bfad_im_supported_speeds(struct bfa_s *bfa) 916bfad_im_supported_speeds(struct bfa_s *bfa)
917{ 917{
918 struct bfa_ioc_attr_s ioc_attr; 918 struct bfa_ioc_attr_s *ioc_attr;
919 u32 supported_speed = 0; 919 u32 supported_speed = 0;
920 920
921 bfa_get_attr(bfa, &ioc_attr); 921 ioc_attr = kzalloc(sizeof(struct bfa_ioc_attr_s), GFP_KERNEL);
922 if (ioc_attr.adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) { 922 if (!ioc_attr)
923 if (ioc_attr.adapter_attr.is_mezz) { 923 return 0;
924
925 bfa_get_attr(bfa, ioc_attr);
926 if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) {
927 if (ioc_attr->adapter_attr.is_mezz) {
924 supported_speed |= FC_PORTSPEED_8GBIT | 928 supported_speed |= FC_PORTSPEED_8GBIT |
925 FC_PORTSPEED_4GBIT | 929 FC_PORTSPEED_4GBIT |
926 FC_PORTSPEED_2GBIT | FC_PORTSPEED_1GBIT; 930 FC_PORTSPEED_2GBIT | FC_PORTSPEED_1GBIT;
@@ -929,12 +933,13 @@ bfad_im_supported_speeds(struct bfa_s *bfa)
929 FC_PORTSPEED_4GBIT | 933 FC_PORTSPEED_4GBIT |
930 FC_PORTSPEED_2GBIT; 934 FC_PORTSPEED_2GBIT;
931 } 935 }
932 } else if (ioc_attr.adapter_attr.max_speed == BFA_PORT_SPEED_4GBPS) { 936 } else if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_4GBPS) {
933 supported_speed |= FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT | 937 supported_speed |= FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT |
934 FC_PORTSPEED_1GBIT; 938 FC_PORTSPEED_1GBIT;
935 } else if (ioc_attr.adapter_attr.max_speed == BFA_PORT_SPEED_10GBPS) { 939 } else if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_10GBPS) {
936 supported_speed |= FC_PORTSPEED_10GBIT; 940 supported_speed |= FC_PORTSPEED_10GBIT;
937 } 941 }
942 kfree(ioc_attr);
938 return supported_speed; 943 return supported_speed;
939} 944}
940 945
@@ -944,9 +949,8 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
944 struct Scsi_Host *host = im_port->shost; 949 struct Scsi_Host *host = im_port->shost;
945 struct bfad_s *bfad = im_port->bfad; 950 struct bfad_s *bfad = im_port->bfad;
946 struct bfad_port_s *port = im_port->port; 951 struct bfad_port_s *port = im_port->port;
947 struct bfa_port_attr_s pattr;
948 struct bfa_lport_attr_s port_attr;
949 char symname[BFA_SYMNAME_MAXLEN]; 952 char symname[BFA_SYMNAME_MAXLEN];
953 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa);
950 954
951 fc_host_node_name(host) = 955 fc_host_node_name(host) =
952 cpu_to_be64((bfa_fcs_lport_get_nwwn(port->fcs_port))); 956 cpu_to_be64((bfa_fcs_lport_get_nwwn(port->fcs_port)));
@@ -964,15 +968,12 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
964 /* For fibre channel services type 0x20 */ 968 /* For fibre channel services type 0x20 */
965 fc_host_supported_fc4s(host)[7] = 1; 969 fc_host_supported_fc4s(host)[7] = 1;
966 970
967 bfa_fcs_lport_get_attr(&bfad->bfa_fcs.fabric.bport, &port_attr); 971 strncpy(symname, bfad->bfa_fcs.fabric.bport.port_cfg.sym_name.symname,
968 strncpy(symname, port_attr.port_cfg.sym_name.symname,
969 BFA_SYMNAME_MAXLEN); 972 BFA_SYMNAME_MAXLEN);
970 sprintf(fc_host_symbolic_name(host), "%s", symname); 973 sprintf(fc_host_symbolic_name(host), "%s", symname);
971 974
972 fc_host_supported_speeds(host) = bfad_im_supported_speeds(&bfad->bfa); 975 fc_host_supported_speeds(host) = bfad_im_supported_speeds(&bfad->bfa);
973 976 fc_host_maxframe_size(host) = fcport->cfg.maxfrsize;
974 bfa_fcport_get_attr(&bfad->bfa, &pattr);
975 fc_host_maxframe_size(host) = pattr.pport_cfg.maxfrsize;
976} 977}
977 978
978static void 979static void