Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* tu controllers and PCI slots
@ 2001-06-22  7:29 Graziano Giuliani
  2001-06-25 15:51 ` Brian Haley
  0 siblings, 1 reply; 2+ messages in thread
From: Graziano Giuliani @ 2001-06-22  7:29 UTC (permalink / raw)


Hello !

I do have an old AS255/300 Digital UNIX V4.0E (Rev. 1091) with on-board
Tulip ethernet controller and DE500 Tulip ethernet controller system
option on PCI slots (total of 2 NIC's).

The two NIC's, on SRM console, shows up as:

ewa0.0.0.14 ---> forced on slot 14 of pci bus on-board controller
ewb0.0.0.11 ---> DE500 system option

I have tried all 3 PCI slots, and they are slot 10, 11, and 12.
All slots works after kernel recompilation.

So for the environment. Now the problem. I do use a proprietary software
which is linked to this particular machine, in particular it recognizes as
host id the ethernet mac-address of the controller on the motherboard.
All works without DE500 system option. When i do install it, the host id
changes to the mac-address of the DE500 ethernet controller and the software
simply refuses to work. This behaviour is reflected in the ifconfig program,
which lists the DE500 controller before the on board controller. It does not
depend on the name of the controller: I have swapped tu0 and tu1 in
kernel configuration file, ifconfig lists tu1 with DE500 before tu0 with
on-board controller.

#####
[root@mymach conf]# ifconfig -a
tu1: flags=c63<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST,SIMPLEX>
     inet 190.1.1.10 netmask ffffff00 broadcast 190.1.1.255 ipmtu 1500 

tu0: flags=c63<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST,SIMPLEX>
     inet 190.1.2.10 netmask ffffff00 broadcast 190.1.2.255 ipmtu 1500 

......
#####

It seems that device listing for ifconfig is created making a PCI scanbus.
I.E., the DE500, which can be on slot 10, 11, or 12, is always listed
before the on-board controller, which is forced on pci slot 14.
I have no support from the owner of the software I use (they proposed me
to buy a whole new license ! For the same machine I am licensed !).
I do need to have 2 NICS to avoid communication from the on-board controller
to be seen for security reasons on my public network.

So the questions:

*) Is my diagnosis right ? 
*) In case, how can I relocate on-board controller from slot 14 to
   slot < 10 ?
*) Can I avoid the problem in some other way ?

Actually I am forced to mantain two distinct kernels and make a system
reboot whenever I want to use the proprietary software !!!

Any help will be appreciated.

Graziano.


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

* Re: tu controllers and PCI slots
  2001-06-22  7:29 tu controllers and PCI slots Graziano Giuliani
@ 2001-06-25 15:51 ` Brian Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Haley @ 2001-06-25 15:51 UTC (permalink / raw)


Graziano Giuliani wrote:

> It seems that device listing for ifconfig is created making a PCI scanbus.
> I.E., the DE500, which can be on slot 10, 11, or 12, is always listed
> before the on-board controller, which is forced on pci slot 14.
> *) Is my diagnosis right ?

Looks right to me.


> *) Can I avoid the problem in some other way ?

You can tell the software vendor to pick better a license mechanism, this
doesn't even allow you to upgrade your hardware without spending
$$$ on a license.

Without knowing exactly how they are choosing tu1 (an interface flag set,
IP address configured, etc), it's hard to know exactly how to get around it,
but here are a couple of suggestions:

1. Upgrade to V5.1 of Tru64, since there the interfaces are always in
    alphabetical order (tu0 will be before tu1).

2. Change the Ethernet address of tu1 to be the same as tu0, this shouldn't
    cause any problems as long as they are in separate subnets.  I've included
    some code below that you need to compile, then call it from /etc/inet.local

    and see what happens.

-Brian

------------------------------------------------------
Brian P. Haley            enet: brian.haley@compaq.com
Tru64 UNIX Networking Group
Compaq Computer Corporation

/*
 * sphyaddr - set a network adapter's physical Ethernet hardware address
 *
 * to compile: cc sphyaddr.c -o sphyaddr
 *
 * usage: sphyaddr tu0 08-00-2b-ff-ff-ff
 */

#define _SOCKADDR_LEN

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>

#include <net/if.h>
#include <net/if_dl.h>
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/if_ether.h>

#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <errno.h>


/* function prototype */
void ether_aton(char *, u_char *);


int
main (int argc, char **argv)
{
    int s, n;
    u_char *cp;
    static struct ifdevea devea;
    static struct ifreq newaddress;

    if (argc < 3) {
        fprintf(stderr, "usage: %s: interface address\n", argv[0]);
        fprintf(stderr, "for example: %s tu0 08-00-2b-ff-ff-ff\n", argv[0]);
        exit(1);
    }

    s = socket(AF_INET, SOCK_DGRAM, 0);

    strcpy(devea.ifr_name, argv[1]);
    strcpy(newaddress.ifr_name, argv[1]);

    /*
     * get current address from driver
     */
    if ((ioctl(s, SIOCRPHYSADDR, &devea) < 0))  {
        perror("couldn't get devea from driver");
    } else {
        /*
         * print the current address
         */
        cp = (u_char *)devea.current_pa;
        n = 0;
        printf("Current: ");
        do {
            printf("%02X-", cp[n++]);
        } while (n < sizeof(devea.current_pa) - 1);
        printf("%02X\n", cp[n++]);

        /*
         * print the target address
         */
        printf("Target : %s\n", argv[2]);

        /* convert it */
        cp = (u_char *)argv[2];
        ether_aton((char *)cp, (u_char *)newaddress.ifr_addr.sa_data);

        newaddress.ifr_addr.sa_family = AF_LINK;
        newaddress.ifr_addr.sa_len = sizeof(newaddress.ifr_addr);

        /* set it */
        if ((ioctl(s, SIOCSPHYSADDR, &newaddress) < 0)) {
            perror("couldn't set devea");
        }

        exit(0);
    }
    exit(1);
}

/*
 * Convert an ASCII Ethernet address to a numeric address
 */
void
ether_aton(char *a,
           u_char *n)
{
    int i, o[6];

    i = sscanf(a, "%x-%x-%x-%x-%x-%x", &o[0], &o[1], &o[2],
                                       &o[3], &o[4], &o[5]);
    if (i != 6) {
        fprintf(stderr, "invalid Ethernet address '%s'\n", a);
        exit(1);
    }

    for (i = 0; i < 6; i++)
        n[i] = o[i];

    return;
}





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

end of thread, other threads:[~2001-06-25 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-22  7:29 tu controllers and PCI slots Graziano Giuliani
2001-06-25 15:51 ` Brian Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox