From: Uri Y. <Uri...@ng...> - 2010-10-31 09:32:01
|
Hi Unfortunately in kernels prior to 2.6.28 fc_vport_create() is declared static. I don't see how can I call it from outside the scsi_transport_fc.c without adding a kernel patch, except maybe writing To /sys/class/fc_host/hostX/vport_create in the kernel. Regards Uri -----Original Message----- From: Vladislav Bolkhovitin [mailto:vs...@vl...] Sent: Friday, October 29, 2010 2:30 PM To: Uri Yanai Cc: cr...@gm...; scs...@li...; Dorit Halsadi Subject: Re: [Scst-devel] To export a 3 parameters fc_vport_create for qla2xxx Hello Uri, Could you look to update the driver so it works on the early kernels, please? As far as I can see it can't be built on 2.6.27 kernels too. In ideal we don't need any patches for any kernel code outside qla2xxx, only a couple of #ifdefs inside. Thanks, Vlad cr...@gm..., on 10/28/2010 10:17 PM wrote: > From: Cheng Renquan <cr...@gm...> > > To build latest qla2xxx from scst/trunk/ on top of linux-2.6.26 seems need > this, I'm not sure if someone met this problem or has done this before; > With this patch in my test, scst/trunk/ scst and qla2x00t target code seems > run well on top of QLE24xx/25xx; > > And if verified needed, I think the qla2x00t-howto file also need an update, > http://scst.sourceforge.net/qla2x00t-howto.html > > Index: linux-2.6.26/drivers/scsi/scsi_transport_fc.c > =================================================================== > --- linux-2.6.26.orig/drivers/scsi/scsi_transport_fc.c 2010-10-29 01:35:47.078823554 +0800 > +++ linux-2.6.26/drivers/scsi/scsi_transport_fc.c 2010-10-29 01:45:36.110823553 +0800 > @@ -41,30 +41,7 @@ > static int fc_queue_work(struct Scsi_Host *, struct work_struct *); > static void fc_vport_sched_delete(struct work_struct *work); > > -/* > - * This is a temporary carrier for creating a vport. It will eventually > - * be replaced by a real message definition for sgio or netlink. > - * > - * fc_vport_identifiers: This set of data contains all elements > - * to uniquely identify and instantiate a FC virtual port. > - * > - * Notes: > - * symbolic_name: The driver is to append the symbolic_name string data > - * to the symbolic_node_name data that it generates by default. > - * the resulting combination should then be registered with the switch. > - * It is expected that things like Xen may stuff a VM title into > - * this field. > - */ > -struct fc_vport_identifiers { > - u64 node_name; > - u64 port_name; > - u32 roles; > - bool disable; > - enum fc_port_type vport_type; /* only FC_PORTTYPE_NPIV allowed */ > - char symbolic_name[FC_VPORT_SYMBOLIC_NAMELEN]; > -}; > - > -static int fc_vport_create(struct Scsi_Host *shost, int channel, > +static int fc_vport_setup(struct Scsi_Host *shost, int channel, > struct device *pdev, struct fc_vport_identifiers *ids, > struct fc_vport **vport); > > @@ -1759,7 +1736,7 @@ > vid.disable = false; /* always enabled */ > > /* we only allow support on Channel 0 !!! */ > - stat = fc_vport_create(shost, 0, &shost->shost_gendev, &vid, &vport); > + stat = fc_vport_setup(shost, 0, &shost->shost_gendev, &vid, &vport); > return stat ? stat : count; > } > static FC_DEVICE_ATTR(host, vport_create, S_IWUSR, NULL, > @@ -3102,7 +3079,7 @@ > > > /** > - * fc_vport_create - allocates and creates a FC virtual port. > + * fc_vport_setup - allocates and creates a FC virtual port. > * @shost: scsi host the virtual port is connected to. > * @channel: Channel on shost port connected to. > * @pdev: parent device for vport > @@ -3117,7 +3094,7 @@ > * This routine assumes no locks are held on entry. > */ > static int > -fc_vport_create(struct Scsi_Host *shost, int channel, struct device *pdev, > +fc_vport_setup(struct Scsi_Host *shost, int channel, struct device *pdev, > struct fc_vport_identifiers *ids, struct fc_vport **ret_vport) > { > struct fc_host_attrs *fc_host = shost_to_fc_host(shost); > @@ -3230,6 +3207,28 @@ > return error; > } > > +/** > + * fc_vport_create - Admin App or LLDD requests creation of a vport > + * @shost: scsi host the virtual port is connected to. > + * @channel: channel on shost port connected to. > + * @ids: The world wide names, FC4 port roles, etc for > + * the virtual port. > + * > + * Notes: > + * This routine assumes no locks are held on entry. > + */ > +struct fc_vport * > +fc_vport_create(struct Scsi_Host *shost, int channel, > + struct fc_vport_identifiers *ids) > +{ > + int stat; > + struct fc_vport *vport; > + > + stat = fc_vport_setup(shost, channel, &shost->shost_gendev, > + ids, &vport); > + return stat ? NULL : vport; > +} > +EXPORT_SYMBOL(fc_vport_create); > > /** > * fc_vport_terminate - Admin App or LLDD requests termination of a vport > Index: linux-2.6.26/include/scsi/scsi_transport_fc.h > =================================================================== > --- linux-2.6.26.orig/include/scsi/scsi_transport_fc.h 2010-10-29 01:39:10.106823554 +0800 > +++ linux-2.6.26/include/scsi/scsi_transport_fc.h 2010-10-29 01:49:49.078823552 +0800 > @@ -198,6 +198,30 @@ > */ > > #define FC_VPORT_SYMBOLIC_NAMELEN 64 > + > +/* > + * This is a temporary carrier for creating a vport. It will eventually > + * be replaced by a real message definition for sgio or netlink. > + * > + * fc_vport_identifiers: This set of data contains all elements > + * to uniquely identify and instantiate a FC virtual port. > + * > + * Notes: > + * symbolic_name: The driver is to append the symbolic_name string data > + * to the symbolic_node_name data that it generates by default. > + * the resulting combination should then be registered with the switch. > + * It is expected that things like Xen may stuff a VM title into > + * this field. > + */ > +struct fc_vport_identifiers { > + u64 node_name; > + u64 port_name; > + u32 roles; > + bool disable; > + enum fc_port_type vport_type; /* only FC_PORTTYPE_NPIV allowed */ > + char symbolic_name[FC_VPORT_SYMBOLIC_NAMELEN]; > +}; > + > struct fc_vport { > /* Fixed Attributes */ > > @@ -732,6 +756,8 @@ > * be sure to read the Vendor Type and ID formatting requirements > * specified in scsi_netlink.h > */ > +struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel, > + struct fc_vport_identifiers *ids); > int fc_vport_terminate(struct fc_vport *vport); > > #endif /* SCSI_TRANSPORT_FC_H */ > > -- > Cheng Renquan, Singapore > > ------------------------------------------------------------------------ ------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Scst-devel mailing list > Scs...@li... > https://lists.sourceforge.net/lists/listinfo/scst-devel > |