Subversion Repositories HelenOS

Rev

Rev 4411 | Rev 4428 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4411 Rev 4416
Line 113... Line 113...
113
    return 0;
113
    return 0;
114
}
114
}
115
 
115
 
116
static int gxe_bd_init(void)
116
static int gxe_bd_init(void)
117
{
117
{
118
    int driver_phone;
-
 
119
    dev_handle_t dev_handle;
118
    dev_handle_t dev_handle;
120
    void *vaddr;
119
    void *vaddr;
121
    int rc;
120
    int rc;
122
 
121
 
123
    rc = devmap_driver_register(NAME, gxe_bd_connection);
122
    rc = devmap_driver_register(NAME, gxe_bd_connection);
124
    if (rc < 0) {
123
    if (rc < 0) {
125
        printf(NAME ": Unable to register driver.\n");
124
        printf(NAME ": Unable to register driver.\n");
126
        return rc;
125
        return rc;
127
    }
126
    }
128
    driver_phone = rc;
-
 
129
 
127
 
130
    rc = pio_enable((void *) dev_physical, sizeof(gxe_bd_t), &vaddr);
128
    rc = pio_enable((void *) dev_physical, sizeof(gxe_bd_t), &vaddr);
131
    if (rc != EOK) {
129
    if (rc != EOK) {
132
        printf(NAME ": Could not initialize device I/O space.\n");
130
        printf(NAME ": Could not initialize device I/O space.\n");
133
        return rc;
131
        return rc;
Line 141... Line 139...
141
        return rc;
139
        return rc;
142
    }
140
    }
143
 
141
 
144
    devbuf = vaddr;
142
    devbuf = vaddr;
145
 
143
 
146
    rc = devmap_device_register(driver_phone, "disk0", &dev_handle);
144
    rc = devmap_device_register("disk0", &dev_handle);
147
    if (rc != EOK) {
145
    if (rc != EOK) {
148
        ipc_hangup(driver_phone);
146
        devmap_hangup_phone(DEVMAP_DRIVER);
149
        printf(NAME ": Unable to register device.\n");
147
        printf(NAME ": Unable to register device.\n");
150
        return rc;
148
        return rc;
151
    }
149
    }
152
 
150
 
153
    return EOK;
151
    return EOK;