I spent a bit of time trying to write a simple Perl script to parse the output of `camcontrol smpphylist` and ran into a wall: there is no way to get the *local* WWPN of the expander. You can see all the WWPNs on the devices connected to it (which might include other expanders) but given two phylists from expanders that are physically connected to each other, there's no way to tell (except by heuristic matching) that 0x5000ccab054d0b3d and 0x5000ccab054d0b7d are in fact wired together.