FORWARD _PROTOTYPE( void do_dev_name_s, (message *mp) );
FORWARD _PROTOTYPE( void do_slot_name, (message *mp) );
FORWARD _PROTOTYPE( void do_slot_name_s, (message *mp) );
-FORWARD _PROTOTYPE( void do_acl, (message *mp) );
+FORWARD _PROTOTYPE( void do_set_acl, (message *mp) );
+FORWARD _PROTOTYPE( void do_del_acl, (message *mp) );
FORWARD _PROTOTYPE( void do_reserve, (message *mp) );
FORWARD _PROTOTYPE( void do_attr_r8, (message *mp) );
FORWARD _PROTOTYPE( void do_attr_r16, (message *mp) );
case BUSC_PCI_RESCAN: do_rescan_bus(&m); break;
case BUSC_PCI_DEV_NAME_S: do_dev_name_s(&m); break;
case BUSC_PCI_SLOT_NAME_S: do_slot_name_s(&m); break;
- case BUSC_PCI_ACL: do_acl(&m); break;
+ case BUSC_PCI_SET_ACL: do_set_acl(&m); break;
+ case BUSC_PCI_DEL_ACL: do_del_acl(&m); break;
case PROC_EVENT: do_sig_handler(); break;
default:
printf("PCI: got message from %d, type %d\n",
}
}
-PRIVATE void do_acl(mp)
+PRIVATE void do_set_acl(mp)
message *mp;
{
int i, r, gid;
if (mp->m_source != RS_PROC_NR)
{
- printf("PCI: do_acl: not from RS\n");
+ printf("PCI: do_set_acl: not from RS\n");
reply(mp, EPERM);
return;
}
}
if (i >= NR_DRIVERS)
{
- printf("PCI: do_acl: table is full\n");
+ printf("PCI: do_set_acl: table is full\n");
reply(mp, ENOMEM);
return;
}
sizeof(acl[i].acl), D);
if (r != OK)
{
- printf("PCI: do_acl: safecopyfrom failed\n");
+ printf("PCI: do_set_acl: safecopyfrom failed\n");
reply(mp, r);
return;
}
reply(mp, OK);
}
+PRIVATE void do_del_acl(mp)
+message *mp;
+{
+ int i, r, proc_nr;
+
+ if (mp->m_source != RS_PROC_NR)
+ {
+ printf("do_del_acl: not from RS\n");
+ reply(mp, EPERM);
+ return;
+ }
+
+ proc_nr= mp->m1_i1;
+
+ for (i= 0; i<NR_DRIVERS; i++)
+ {
+ if (!acl[i].inuse)
+ continue;
+ if (acl[i].acl.rsp_endpoint == proc_nr)
+ break;
+ }
+
+ if (i >= NR_DRIVERS)
+ {
+ printf("do_del_acl: nothing found for %d\n", proc_nr);
+ reply(mp, EINVAL);
+ return;
+ }
+
+ acl[i].inuse= 0;
+ printf("do_acl: deleting ACL for %d ('%s') at entry %d\n",
+ acl[i].acl.rsp_endpoint, acl[i].acl.rsp_label, i);
+
+ reply(mp, OK);
+}
+
PRIVATE void do_reserve(mp)
message *mp;
{
vid, did, headt, sts);
#endif
- if (vid == NO_VID)
+ if (vid == NO_VID && did == NO_VID)
{
if (func == 0)
break; /* Nothing here */
PRIVATE void print_capabilities(devind)
int devind;
{
- u8_t status, capptr, type, next;
+ u8_t status, capptr, type, next, subtype;
char *str;
/* Check capabilities bit in the device status register */
case 5: str= "Message Signaled Interrupts"; break;
case 6: str= "CompactPCI Hot Swap"; break;
case 8: str= "AMD HyperTransport"; break;
- case 0xf: str= "AMD I/O MMU"; break;
- defuault: str= "(unknown type)"; break;
+ case 0xf: str= "Secure Device"; break;
+ default: str= "(unknown type)"; break;
}
- printf(" @0x%x: capability type 0x%x: %s\n",
+ printf(" @0x%x: capability type 0x%x: %s",
capptr, type, str);
+ if (type == 0x0f)
+ {
+ subtype= (pci_attr_r8(devind, capptr+2) & 0x07);
+ switch(subtype)
+ {
+ case 2: str= "Device Exclusion Vector"; break;
+ case 3: str= "IOMMU"; break;
+ default: str= "(unknown type)"; break;
+ }
+ printf(", sub type 0%o: %s", subtype, str);
+ }
+ printf("\n");
capptr= next;
}
}