diff options
Diffstat (limited to 'kernel/xpp/xpp_zap.c')
-rw-r--r-- | kernel/xpp/xpp_zap.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/kernel/xpp/xpp_zap.c b/kernel/xpp/xpp_zap.c index edaedf9..afa34e9 100644 --- a/kernel/xpp/xpp_zap.c +++ b/kernel/xpp/xpp_zap.c @@ -426,7 +426,7 @@ xpd_t *xpd_alloc(size_t privsize, const xproto_table_t *proto_table, int channel size_t alloc_size = sizeof(xpd_t) + privsize; int type = proto_table->type; - DBG(DEVICES, "type=%d channels=%d (alloc_size=%d)\n", + DBG(DEVICES, "type=%d channels=%d (alloc_size=%zd)\n", type, channels, alloc_size); if(channels > CHANNELS_PERXPD) { ERR("%s: type=%d: too many channels %d\n", @@ -917,6 +917,40 @@ static int zaptel_register_xpd(xpd_t *xpd) span->hooksig = xpp_hooksig; /* Only with RBS bits */ span->ioctl = xpp_ioctl; span->maint = xpp_maint; +#ifdef ZT_SPANSTAT_V2 + /* + * This actually describe the zt_spaninfo version 3 + * A bunch of unrelated data exported via a modified ioctl() + * What a bummer... + */ + span->manufacturer = "Xorcom Inc."; /* OK, that's obvious */ + /* span->spantype = "...."; set in card_zaptel_preregistration() */ + /* + * Yes, this basically duplicates information available + * from the description field. If some more is needed + * why not add it there? + * OK, let's add to the kernel more useless info. + */ + snprintf(span->devicetype, sizeof(span->devicetype) - 1, + "Astribank: Unit %x Subunit %x: %s", + XBUS_UNIT(xpd->xbus_idx), XBUS_SUBUNIT(xpd->xbus_idx), + xpd->type_name); + /* + * location is the only usefull new data item. + * For our devices it was available for ages via: + * - The legacy "/proc/xpp/XBUS-??/summary" (CONNECTOR=...) + * - The same info in "/proc/xpp/xbuses" + * - The modern "/sys/bus/astribanks/devices/xbus-??/connector" attribute + * So let's also export it via the newfangled "location" field. + */ + snprintf(span->location, sizeof(span->location) - 1, "%s", xbus->location); + /* + * Who said a span and irq have 1-1 relationship? + * Also exporting this low-level detail isn't too wise. + * No irq's for you today! + */ + span->irq = 0; +#endif #ifdef ZAPTEL_SYNC_TICK span->sync_tick = zaptel_sync_tick; #endif |