All of lore.kernel.org
 help / color / mirror / Atom feed
* Associate physical device with device name
@ 2018-01-26 14:38 Jimmy Assarsson
  2018-02-08 12:05 ` Jimmy Assarsson
  2018-02-08 12:45 ` Marc Kleine-Budde
  0 siblings, 2 replies; 12+ messages in thread
From: Jimmy Assarsson @ 2018-01-26 14:38 UTC (permalink / raw)
  To: linux-can

Hi,

We would like to be able to associate physical (Kvaser) USB devices with
their device names (can0 etc.).
The interface's EAN (article number) combined with serial number, form a
unique identifier.

It is not possible to do this from the USB descriptor. Since the serial
number is not provided in the USB descriptor. And the same PID is reused
for multiple EAN numbers. It is preferable with a solution that is
independent of interface type (USB etc.), since we may support other
devices in the future.

This is somewhat similar to '"user id" for can usb adapters',
https://marc.info/?l=linux-can&m=146565019622100

What is the preferable way of solving this kind of problem? Is sysfs
suitable?


Regards,
Jimmy

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-01-26 14:38 Associate physical device with device name Jimmy Assarsson
@ 2018-02-08 12:05 ` Jimmy Assarsson
  2018-02-08 12:45 ` Marc Kleine-Budde
  1 sibling, 0 replies; 12+ messages in thread
From: Jimmy Assarsson @ 2018-02-08 12:05 UTC (permalink / raw)
  To: linux-can

On 2018-01-26 15:38, Jimmy Assarsson wrote:
> We would like to be able to associate physical (Kvaser) USB devices with
> their device names (can0 etc.).
> The interface's EAN (article number) combined with serial number, form a
> unique identifier.
> 
> It is not possible to do this from the USB descriptor. Since the serial
> number is not provided in the USB descriptor. And the same PID is reused
> for multiple EAN numbers. It is preferable with a solution that is
> independent of interface type (USB etc.), since we may support other
> devices in the future.
> 
> This is somewhat similar to '"user id" for can usb adapters',
> https://marc.info/?l=linux-can&m=146565019622100
> 
> What is the preferable way of solving this kind of problem? Is sysfs
> suitable?

No suggestions or opinions on this?

Regards,
Jimmy

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-01-26 14:38 Associate physical device with device name Jimmy Assarsson
  2018-02-08 12:05 ` Jimmy Assarsson
@ 2018-02-08 12:45 ` Marc Kleine-Budde
  2018-02-08 13:04   ` Jimmy Assarsson
  1 sibling, 1 reply; 12+ messages in thread
From: Marc Kleine-Budde @ 2018-02-08 12:45 UTC (permalink / raw)
  To: Jimmy Assarsson, linux-can


[-- Attachment #1.1: Type: text/plain, Size: 1297 bytes --]

On 01/26/2018 03:38 PM, Jimmy Assarsson wrote:
> We would like to be able to associate physical (Kvaser) USB devices with
> their device names (can0 etc.).
> The interface's EAN (article number) combined with serial number, form a
> unique identifier.
> 
> It is not possible to do this from the USB descriptor. Since the serial
> number is not provided in the USB descriptor. And the same PID is reused
> for multiple EAN numbers. It is preferable with a solution that is
> independent of interface type (USB etc.), since we may support other
> devices in the future.
> 
> This is somewhat similar to '"user id" for can usb adapters',
> https://marc.info/?l=linux-can&m=146565019622100
> 
> What is the preferable way of solving this kind of problem? Is sysfs
> suitable?

Are your adaptors 100% idential? Then there is no way to tell them apart
in software. However you should be possible to write a custom udev rule
to rename the adapter depending on the physical USB-Port you are using.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-02-08 12:45 ` Marc Kleine-Budde
@ 2018-02-08 13:04   ` Jimmy Assarsson
  2018-02-09  7:50     ` Jimmy Assarsson
  2018-02-09 10:47     ` Marc Kleine-Budde
  0 siblings, 2 replies; 12+ messages in thread
From: Jimmy Assarsson @ 2018-02-08 13:04 UTC (permalink / raw)
  To: Marc Kleine-Budde, linux-can

On 2018-02-08 13:45, Marc Kleine-Budde wrote:
> On 01/26/2018 03:38 PM, Jimmy Assarsson wrote:
>> We would like to be able to associate physical (Kvaser) USB devices with
>> their device names (can0 etc.).
>> The interface's EAN (article number) combined with serial number, form a
>> unique identifier.
>>
>> It is not possible to do this from the USB descriptor. Since the serial
>> number is not provided in the USB descriptor. And the same PID is reused
>> for multiple EAN numbers. It is preferable with a solution that is
>> independent of interface type (USB etc.), since we may support other
>> devices in the future.
>>
>> This is somewhat similar to '"user id" for can usb adapters',
>> https://marc.info/?l=linux-can&m=146565019622100
>>
>> What is the preferable way of solving this kind of problem? Is sysfs
>> suitable?
> 
> Are your adaptors 100% idential? Then there is no way to tell them apart
> in software. However you should be possible to write a custom udev rule
> to rename the adapter depending on the physical USB-Port you are using.

No, they are not identical. The EAN and serial number is stored on the
device. Which makes a single device unique. It is possible to fetch
these from the device. And same applies to all Kvaser CAN interfaces,
regardless if they are connected via USB, PCI-express or ethernet.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-02-08 13:04   ` Jimmy Assarsson
@ 2018-02-09  7:50     ` Jimmy Assarsson
  2018-02-09 10:47     ` Marc Kleine-Budde
  1 sibling, 0 replies; 12+ messages in thread
From: Jimmy Assarsson @ 2018-02-09  7:50 UTC (permalink / raw)
  To: Marc Kleine-Budde, linux-can

On 2018-02-08 14:04, Jimmy Assarsson wrote:
> On 2018-02-08 13:45, Marc Kleine-Budde wrote:
>> On 01/26/2018 03:38 PM, Jimmy Assarsson wrote:
>>> We would like to be able to associate physical (Kvaser) USB devices with
>>> their device names (can0 etc.).
>>> The interface's EAN (article number) combined with serial number, form a
>>> unique identifier.
>>>
>>> It is not possible to do this from the USB descriptor. Since the serial
>>> number is not provided in the USB descriptor. And the same PID is reused
>>> for multiple EAN numbers. It is preferable with a solution that is
>>> independent of interface type (USB etc.), since we may support other
>>> devices in the future.
>>>
>>> This is somewhat similar to '"user id" for can usb adapters',
>>> https://marc.info/?l=linux-can&m=146565019622100
>>>
>>> What is the preferable way of solving this kind of problem? Is sysfs
>>> suitable?
>>
>> Are your adaptors 100% idential? Then there is no way to tell them apart
>> in software. However you should be possible to write a custom udev rule
>> to rename the adapter depending on the physical USB-Port you are using.
> 
> No, they are not identical. The EAN and serial number is stored on the
> device. Which makes a single device unique. It is possible to fetch
> these from the device. And same applies to all Kvaser CAN interfaces,
> regardless if they are connected via USB, PCI-express or ethernet.

Maybe the initial question was fuzzy. We want to achieve the following:
The user got two devices, one with SN (serial number) 5 and one with SN
6. The device with SN 5 is connected to CAN bus 'A' and the one with SN
6 is connected to CAN bus 'B'. The user connects the devices in
arbitrary order. And starts a user space application that should
communicate on CAN bus 'B'. The application should find and use the
netdev (can0 or can1) for the device with SN 6.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-02-08 13:04   ` Jimmy Assarsson
  2018-02-09  7:50     ` Jimmy Assarsson
@ 2018-02-09 10:47     ` Marc Kleine-Budde
  2018-02-09 11:21       ` Jimmy Assarsson
  1 sibling, 1 reply; 12+ messages in thread
From: Marc Kleine-Budde @ 2018-02-09 10:47 UTC (permalink / raw)
  To: Jimmy Assarsson, linux-can


[-- Attachment #1.1: Type: text/plain, Size: 793 bytes --]

On 02/08/2018 02:04 PM, Jimmy Assarsson wrote:
> No, they are not identical. The EAN and serial number is stored on the
> device.

How to read them?

> Which makes a single device unique. It is possible to fetch these
> from the device. And same applies to all Kvaser CAN interfaces, 
> regardless if they are connected via USB, PCI-express or ethernet.
What's the output of the udev when using the proper path to your device?

"udevadm info --path=/devices/pci0000:00/0000:00:14.0/usb1/1-2/ -a"

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-02-09 10:47     ` Marc Kleine-Budde
@ 2018-02-09 11:21       ` Jimmy Assarsson
  2018-02-09 13:24         ` Marc Kleine-Budde
  0 siblings, 1 reply; 12+ messages in thread
From: Jimmy Assarsson @ 2018-02-09 11:21 UTC (permalink / raw)
  To: Marc Kleine-Budde, linux-can

On 2018-02-09 11:47, Marc Kleine-Budde wrote:
> On 02/08/2018 02:04 PM, Jimmy Assarsson wrote:
>> No, they are not identical. The EAN and serial number is stored on the
>> device.
> 
> How to read them?

It is part of the "kvaser_msg_cardinfo" command, see
https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git/tree/drivers/net/can/usb/kvaser_usb.c#n198

>> Which makes a single device unique. It is possible to fetch these
>> from the device. And same applies to all Kvaser CAN interfaces,
>> regardless if they are connected via USB, PCI-express or ethernet.
> What's the output of the udev when using the proper path to your device?
> 
> "udevadm info --path=/devices/pci0000:00/0000:00:14.0/usb1/1-2/ -a"

All devices with the same EAN look identical, since we do not set serial
number in the USB descriptor.

The output from "udevadm info 
--path=/sys/devices/pci0000:00/0000:00:02.1/usb1/1-4/1-4.1/1-4.1:1.0 -a"

   looking at device 
'/devices/pci0000:00/0000:00:02.1/usb1/1-4/1-4.1/1-4.1:1.0':
     KERNEL=="1-4.1:1.0"
     SUBSYSTEM=="usb"
     DRIVER=="kvaser_usb"
     ATTR{authorized}=="1"
     ATTR{bAlternateSetting}==" 0"
     ATTR{bInterfaceClass}=="00"
     ATTR{bInterfaceNumber}=="00"
     ATTR{bInterfaceProtocol}=="00"
     ATTR{bInterfaceSubClass}=="00"
     ATTR{bNumEndpoints}=="02"
     ATTR{supports_autosuspend}=="0"

   looking at parent device 
'/devices/pci0000:00/0000:00:02.1/usb1/1-4/1-4.1':
     KERNELS=="1-4.1"
     SUBSYSTEMS=="usb"
     DRIVERS=="usb"
     ATTRS{authorized}=="1"
     ATTRS{avoid_reset_quirk}=="0"
     ATTRS{bConfigurationValue}=="1"
     ATTRS{bDeviceClass}=="ff"
     ATTRS{bDeviceProtocol}=="00"
     ATTRS{bDeviceSubClass}=="00"
     ATTRS{bMaxPacketSize0}=="64"
     ATTRS{bMaxPower}=="132mA"
     ATTRS{bNumConfigurations}=="1"
     ATTRS{bNumInterfaces}==" 1"
     ATTRS{bcdDevice}=="0001"
     ATTRS{bmAttributes}=="c0"
     ATTRS{busnum}=="1"
     ATTRS{configuration}==""
     ATTRS{devnum}=="26"
     ATTRS{devpath}=="4.1"
     ATTRS{idProduct}=="0123"
     ATTRS{idVendor}=="0bfd"
     ATTRS{ltm_capable}=="no"
     ATTRS{manufacturer}=="Kvaser AB"
     ATTRS{maxchild}=="0"
     ATTRS{product}=="Kvaser USBcan Light"
     ATTRS{quirks}=="0x0"
     ATTRS{removable}=="unknown"
     ATTRS{speed}=="480"
     ATTRS{urbnum}=="17"
     ATTRS{version}==" 2.00"

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-02-09 11:21       ` Jimmy Assarsson
@ 2018-02-09 13:24         ` Marc Kleine-Budde
  2018-02-09 15:35           ` Jimmy Assarsson
  0 siblings, 1 reply; 12+ messages in thread
From: Marc Kleine-Budde @ 2018-02-09 13:24 UTC (permalink / raw)
  To: Jimmy Assarsson, linux-can


[-- Attachment #1.1: Type: text/plain, Size: 1465 bytes --]

On 02/09/2018 12:21 PM, Jimmy Assarsson wrote:
>>> No, they are not identical. The EAN and serial number is stored on the
>>> device.
>>
>> How to read them?
> 
> It is part of the "kvaser_msg_cardinfo" command, see
> https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git/tree/drivers/net/can/usb/kvaser_usb.c#n198

ok

>>> Which makes a single device unique. It is possible to fetch these
>>> from the device. And same applies to all Kvaser CAN interfaces,
>>> regardless if they are connected via USB, PCI-express or ethernet.
>> What's the output of the udev when using the proper path to your device?
>>
>> "udevadm info --path=/devices/pci0000:00/0000:00:14.0/usb1/1-2/ -a"
> 
> All devices with the same EAN look identical, since we do not set serial
> number in the USB descriptor.

That should be done on the next FW revision.

Ok - I see two possibilities.

1) sysfs file
Add a file to sysfs that contains the serial number, see:
http://lxr.bootlin.com/linux/latest/source/drivers/net/can/softing/softing_main.c#L718

2) ethtool eeprom
You can export the serial number via ethtool's dump eeprom functionality.

Better try 1).

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-02-09 13:24         ` Marc Kleine-Budde
@ 2018-02-09 15:35           ` Jimmy Assarsson
  2018-02-09 17:09             ` Oliver Hartkopp
  0 siblings, 1 reply; 12+ messages in thread
From: Jimmy Assarsson @ 2018-02-09 15:35 UTC (permalink / raw)
  To: Marc Kleine-Budde, linux-can

On 2018-02-09 14:24, Marc Kleine-Budde wrote:
> On 02/09/2018 12:21 PM, Jimmy Assarsson wrote:
>> All devices with the same EAN look identical, since we do not set serial
>> number in the USB descriptor.
> 
> That should be done on the next FW revision.

It is left out on purpose. I don't remember the details, but it had
something to do with Windows reinstalling the driver whenever a device
with different serial number is connected to the same USB port.

> Ok - I see two possibilities.
> 
> 1) sysfs file
> Add a file to sysfs that contains the serial number, see:
> http://lxr.bootlin.com/linux/latest/source/drivers/net/can/softing/softing_main.c#L718
> 
> 2) ethtool eeprom
> You can export the serial number via ethtool's dump eeprom functionality.
> 
> Better try 1).

Great :) Will try this next week.
Thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-02-09 15:35           ` Jimmy Assarsson
@ 2018-02-09 17:09             ` Oliver Hartkopp
  2018-02-10  9:58               ` Kurt Van Dijck
  2018-02-10 11:01               ` André Hartmann
  0 siblings, 2 replies; 12+ messages in thread
From: Oliver Hartkopp @ 2018-02-09 17:09 UTC (permalink / raw)
  To: Jimmy Assarsson, Marc Kleine-Budde, linux-can



On 02/09/2018 04:35 PM, Jimmy Assarsson wrote:
> On 2018-02-09 14:24, Marc Kleine-Budde wrote:
>> On 02/09/2018 12:21 PM, Jimmy Assarsson wrote:
>>> All devices with the same EAN look identical, since we do not set serial
>>> number in the USB descriptor.
>>
>> That should be done on the next FW revision.
> 
> It is left out on purpose. I don't remember the details, but it had
> something to do with Windows reinstalling the driver whenever a device
> with different serial number is connected to the same USB port.
> 
>> Ok - I see two possibilities.
>>
>> 1) sysfs file
>> Add a file to sysfs that contains the serial number, see:
>> http://lxr.bootlin.com/linux/latest/source/drivers/net/can/softing/softing_main.c#L718 
>>
>>
>> 2) ethtool eeprom
>> You can export the serial number via ethtool's dump eeprom functionality.
>>
>> Better try 1).
> 
> Great :) Will try this next week.

Would it make sense to provide a common sysfs infrastructure in

	linux/drivers/net/can/dev.c

to populate

	/sys/class/net/<can-interface-name>/<serial-num-whatever>

instead of maintaining this stuff in each single driver?

We have this requirement in the softing/kvaser/peak adapters so far.

We could provide some pointer in struct can_priv which points to a 
struct which contains the sysfs content - or something like this.

Any thoughts?

Best,
Oliver


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-02-09 17:09             ` Oliver Hartkopp
@ 2018-02-10  9:58               ` Kurt Van Dijck
  2018-02-10 11:01               ` André Hartmann
  1 sibling, 0 replies; 12+ messages in thread
From: Kurt Van Dijck @ 2018-02-10  9:58 UTC (permalink / raw)
  To: Oliver Hartkopp, Jimmy Assarsson, Marc Kleine-Budde, linux-can

Beware that you should have added the sysfs property before you register the can device. Doing it after may be too late since udev is reading the properties already.
I remember that netdev's can add a limited # groups, else you add the serial to de device, not the netdev.
Kurt

On 9 February 2018 18:09:36 CET, Oliver Hartkopp <socketcan@hartkopp.net> wrote:
>
>
>On 02/09/2018 04:35 PM, Jimmy Assarsson wrote:
>> On 2018-02-09 14:24, Marc Kleine-Budde wrote:
>>> On 02/09/2018 12:21 PM, Jimmy Assarsson wrote:
>>>> All devices with the same EAN look identical, since we do not set
>serial
>>>> number in the USB descriptor.
>>>
>>> That should be done on the next FW revision.
>> 
>> It is left out on purpose. I don't remember the details, but it had
>> something to do with Windows reinstalling the driver whenever a
>device
>> with different serial number is connected to the same USB port.
>> 
>>> Ok - I see two possibilities.
>>>
>>> 1) sysfs file
>>> Add a file to sysfs that contains the serial number, see:
>>>
>http://lxr.bootlin.com/linux/latest/source/drivers/net/can/softing/softing_main.c#L718
>
>>>
>>>
>>> 2) ethtool eeprom
>>> You can export the serial number via ethtool's dump eeprom
>functionality.
>>>
>>> Better try 1).
>> 
>> Great :) Will try this next week.
>
>Would it make sense to provide a common sysfs infrastructure in
>
>	linux/drivers/net/can/dev.c
>
>to populate
>
>	/sys/class/net/<can-interface-name>/<serial-num-whatever>
>
>instead of maintaining this stuff in each single driver?
>
>We have this requirement in the softing/kvaser/peak adapters so far.
>
>We could provide some pointer in struct can_priv which points to a 
>struct which contains the sysfs content - or something like this.
>
>Any thoughts?
>
>Best,
>Oliver
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-can" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

Sent from a small mobile device

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Associate physical device with device name
  2018-02-09 17:09             ` Oliver Hartkopp
  2018-02-10  9:58               ` Kurt Van Dijck
@ 2018-02-10 11:01               ` André Hartmann
  1 sibling, 0 replies; 12+ messages in thread
From: André Hartmann @ 2018-02-10 11:01 UTC (permalink / raw)
  To: Oliver Hartkopp, Jimmy Assarsson, Marc Kleine-Budde, linux-can

Hi Oliver,

Am 09.02.2018 um 18:09 schrieb Oliver Hartkopp:
> 
> 
> On 02/09/2018 04:35 PM, Jimmy Assarsson wrote:
>> On 2018-02-09 14:24, Marc Kleine-Budde wrote:
>>> On 02/09/2018 12:21 PM, Jimmy Assarsson wrote:
>>>> All devices with the same EAN look identical, since we do not set 
>>>> serial
>>>> number in the USB descriptor.
>>>
>>> That should be done on the next FW revision.
>>
>> It is left out on purpose. I don't remember the details, but it had
>> something to do with Windows reinstalling the driver whenever a device
>> with different serial number is connected to the same USB port.
>>
>>> Ok - I see two possibilities.
>>>
>>> 1) sysfs file
>>> Add a file to sysfs that contains the serial number, see:
>>> http://lxr.bootlin.com/linux/latest/source/drivers/net/can/softing/softing_main.c#L718 
>>>
>>>
>>> 2) ethtool eeprom
>>> You can export the serial number via ethtool's dump eeprom 
>>> functionality.
>>>
>>> Better try 1).
>>
>> Great :) Will try this next week.
> 
> Would it make sense to provide a common sysfs infrastructure in
> 
>      linux/drivers/net/can/dev.c
> 
> to populate
> 
>      /sys/class/net/<can-interface-name>/<serial-num-whatever>
> 
> instead of maintaining this stuff in each single driver?
> 
> We have this requirement in the softing/kvaser/peak adapters so far.
> 
> We could provide some pointer in struct can_priv which points to a 
> struct which contains the sysfs content - or something like this.

+1. A general solution to read a serial number from sysfs would be very 
welcome.

> Any thoughts?
> 
> Best,
> Oliver
> 
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-02-10 11:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-26 14:38 Associate physical device with device name Jimmy Assarsson
2018-02-08 12:05 ` Jimmy Assarsson
2018-02-08 12:45 ` Marc Kleine-Budde
2018-02-08 13:04   ` Jimmy Assarsson
2018-02-09  7:50     ` Jimmy Assarsson
2018-02-09 10:47     ` Marc Kleine-Budde
2018-02-09 11:21       ` Jimmy Assarsson
2018-02-09 13:24         ` Marc Kleine-Budde
2018-02-09 15:35           ` Jimmy Assarsson
2018-02-09 17:09             ` Oliver Hartkopp
2018-02-10  9:58               ` Kurt Van Dijck
2018-02-10 11:01               ` André Hartmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.