> I converted the amd and adv drivers to new-bus. But, as I am not
> familiar with these drivers and new-bus, maybe I have mistaken.
> 
> Will somebody please review these changes?
> 
> For amd driver:
> http://home.jp.FreeBSD.org/~nyan/patches/amd.diff.gz

Hi,

I'm afraid this code fails in bus_alloc_resource(...SYS_RES_IOPORT...).
I know nothing about what that does, but notice that the old code 
didn't even call pci_map_port() (which makes the compat code call 
bus_alloc_resource)...

I also added these patches - possibly worth leaving in the final 
version of this code ?

Let me know if you need any more data here....

Cheers.
-- 
Brian <[EMAIL PROTECTED]>                        <brian@[uk.]FreeBSD.org>
      <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
Don't _EVER_ lose your sense of humour !

--- amd.c.orig  Mon Apr  3 12:20:52 2000
+++ amd.c       Mon Apr  3 12:42:11 2000
@@ -2256,8 +2256,11 @@
 
        iores = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1,
                                   RF_ACTIVE);
-       if (iores == NULL)
+       if (iores == NULL) {
+               if (bootverbose)
+                       printf("amd_init: bus_alloc_resource failure!\n");
                return ENXIO;
+       }
        amd->tag = rman_get_bustag(iores);
        amd->bsh = rman_get_bushandle(iores);
 
@@ -2271,6 +2274,8 @@
                               /*maxsegsz*/AMD_MAXTRANSFER_SIZE,
                               /*flags*/BUS_DMA_ALLOCNOW,
                               &amd->buffer_dmat) != 0) {
+               if (bootverbose)
+                       printf("amd_init: bus_dma_tag_create failure!\n");
                return ENXIO;
         }
        TAILQ_INIT(&amd->free_srbs);
@@ -2355,8 +2360,11 @@
        void            *ih;
        struct resource *irqres;
 
-       if (amd_init(dev))
+       if (amd_init(dev)) {
+               if (bootverbose)
+                       printf("amd_attach: amd_init failure!\n");
                return ENXIO;
+       }
 
        /* Reset Pending INT */
        intstat = amd_read8(amd, INTSTATREG);
@@ -2379,19 +2387,26 @@
         * max_sim_transactions
         */
        devq = cam_simq_alloc(MAX_START_JOB);
-       if (devq == NULL)
+       if (devq == NULL) {
+               if (bootverbose)
+                       printf("amd_attach: cam_simq_alloc failure!\n");
                return ENXIO;
+       }
 
        amd->psim = cam_sim_alloc(amd_action, amd_poll, "amd",
                                  amd, amd->unit, 1, MAX_TAGS_CMD_QUEUE,
                                  devq);
        if (amd->psim == NULL) {
                cam_simq_free(devq);
+               if (bootverbose)
+                       printf("amd_attach: cam_sim_alloc failure!\n");
                return ENXIO;
        }
 
        if (xpt_bus_register(amd->psim, 0) != CAM_SUCCESS) {
                cam_sim_free(amd->psim, /*free_devq*/TRUE);
+               if (bootverbose)
+                       printf("amd_attach: xpt_bus_register failure!\n");
                return ENXIO;
        }
 
@@ -2400,6 +2415,8 @@
                            CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
                xpt_bus_deregister(cam_sim_path(amd->psim));
                cam_sim_free(amd->psim, /* free_simq */ TRUE);
+               if (bootverbose)
+                       printf("amd_attach: xpt_create_path failure!\n");
                return ENXIO;
        }
 




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to