Changeset a35b458 in mainline for uspace/drv/platform
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- Location:
- uspace/drv/platform
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/platform/amdm37x/main.c
r3061bc1 ra35b458 176 176 if (fnode == NULL) 177 177 return ENOMEM; 178 178 179 179 /* Add match id */ 180 180 errno_t ret = ddf_fun_add_match_id(fnode, fun->id, fun->score); … … 183 183 return ret; 184 184 } 185 185 186 186 /* Alloc needed data */ 187 187 amdm37x_fun_t *rf = … … 195 195 /* Set provided operations to the device. */ 196 196 ddf_fun_set_ops(fnode, &amdm37x_fun_ops); 197 197 198 198 /* Register function. */ 199 199 ret = ddf_fun_bind(fnode); … … 203 203 return ret; 204 204 } 205 205 206 206 return EOK; 207 207 } -
uspace/drv/platform/mac/mac.c
r3061bc1 ra35b458 130 130 ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name); 131 131 printf("mac: Adding new function '%s'.\n", name); 132 132 133 133 ddf_fun_t *fnode = NULL; 134 134 errno_t rc; 135 135 136 136 /* Create new device. */ 137 137 fnode = ddf_fun_create(dev, fun_inner, name); 138 138 if (fnode == NULL) 139 139 goto failure; 140 140 141 141 mac_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(mac_fun_t)); 142 142 *fun = *fun_proto; 143 143 144 144 /* Add match ID */ 145 145 rc = ddf_fun_add_match_id(fnode, str_match_id, 100); 146 146 if (rc != EOK) 147 147 goto failure; 148 148 149 149 /* Set provided operations to the device. */ 150 150 ddf_fun_set_ops(fnode, &mac_fun_ops); 151 151 152 152 /* Register function. */ 153 153 if (ddf_fun_bind(fnode) != EOK) { … … 155 155 goto failure; 156 156 } 157 157 158 158 printf("mac: Added new function '%s' (str=%s).\n", name, str_match_id); 159 159 return true; 160 160 161 161 failure: 162 162 if (fnode != NULL) 163 163 ddf_fun_destroy(fnode); 164 164 165 165 ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name); 166 166 167 167 return false; 168 168 } … … 223 223 mac_fun_t *fun = mac_fun(fnode); 224 224 assert(fun != NULL); 225 225 226 226 return &fun->hw_resources; 227 227 } … … 230 230 { 231 231 /* TODO */ 232 232 233 233 return false; 234 234 } -
uspace/drv/platform/malta/malta.c
r3061bc1 ra35b458 138 138 { 139 139 malta_fun_t *fun = malta_fun(fnode); 140 140 141 141 assert(fun != NULL); 142 142 return &fun->hw_resources; … … 146 146 { 147 147 /* TODO */ 148 148 149 149 return false; 150 150 } … … 175 175 { 176 176 ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name); 177 177 178 178 ddf_fun_t *fnode = NULL; 179 179 errno_t rc; 180 180 181 181 /* Create new device. */ 182 182 fnode = ddf_fun_create(dev, fun_inner, name); 183 183 if (fnode == NULL) 184 184 goto failure; 185 185 186 186 malta_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(malta_fun_t)); 187 187 *fun = *fun_proto; 188 188 189 189 /* Add match ID */ 190 190 rc = ddf_fun_add_match_id(fnode, str_match_id, 100); 191 191 if (rc != EOK) 192 192 goto failure; 193 193 194 194 /* Set provided operations to the device. */ 195 195 ddf_fun_set_ops(fnode, &malta_fun_ops); 196 196 197 197 /* Register function. */ 198 198 if (ddf_fun_bind(fnode) != EOK) { … … 200 200 goto failure; 201 201 } 202 202 203 203 return true; 204 204 205 205 failure: 206 206 if (fnode != NULL) 207 207 ddf_fun_destroy(fnode); 208 208 209 209 ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name); 210 210 211 211 return false; 212 212 } … … 246 246 >[GT_PCI_CMD / sizeof(ioport32_t)], host2uint32_t_le(val)); 247 247 248 248 249 249 /* Register functions. */ 250 250 if (!malta_add_functions(dev)) { 251 251 ddf_msg(LVL_ERROR, "Failed to add functions for the Malta platform."); 252 252 } 253 253 254 254 return EOK; 255 255 } -
uspace/drv/platform/msim/msim.c
r3061bc1 ra35b458 147 147 { 148 148 msim_fun_t *fun = msim_fun(fnode); 149 149 150 150 assert(fun != NULL); 151 151 return &fun->hw_resources; … … 184 184 { 185 185 ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name); 186 186 187 187 ddf_fun_t *fnode = NULL; 188 188 errno_t rc; 189 189 190 190 /* Create new device. */ 191 191 fnode = ddf_fun_create(dev, fun_inner, name); 192 192 if (fnode == NULL) 193 193 goto failure; 194 194 195 195 msim_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(msim_fun_t)); 196 196 if (fun == NULL) 197 197 goto failure; 198 198 199 199 *fun = *fun_proto; 200 200 201 201 /* Add match ID */ 202 202 rc = ddf_fun_add_match_id(fnode, str_match_id, 100); 203 203 if (rc != EOK) 204 204 goto failure; 205 205 206 206 /* Set provided operations to the device. */ 207 207 ddf_fun_set_ops(fnode, &msim_fun_ops); 208 208 209 209 /* Register function. */ 210 210 if (ddf_fun_bind(fnode) != EOK) { … … 212 212 goto failure; 213 213 } 214 214 215 215 return true; 216 216 217 217 failure: 218 218 if (fnode != NULL) 219 219 ddf_fun_destroy(fnode); 220 220 221 221 ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name); 222 222 223 223 return false; 224 224 } … … 246 246 if (!msim_add_functions(dev)) 247 247 ddf_msg(LVL_ERROR, "Failed to add functions for the MSIM platform."); 248 248 249 249 return EOK; 250 250 } -
uspace/drv/platform/pc/pc.c
r3061bc1 ra35b458 120 120 { 121 121 pc_fun_t *fun = pc_fun(fnode); 122 122 123 123 assert(fun != NULL); 124 124 return &fun->hw_resources; … … 128 128 { 129 129 /* TODO */ 130 130 131 131 return false; 132 132 } … … 135 135 { 136 136 pc_fun_t *fun = pc_fun(fnode); 137 137 138 138 assert(fun != NULL); 139 139 return &fun->pio_window; … … 157 157 { 158 158 ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name); 159 159 160 160 ddf_fun_t *fnode = NULL; 161 161 errno_t rc; 162 162 163 163 /* Create new device. */ 164 164 fnode = ddf_fun_create(dev, fun_inner, name); 165 165 if (fnode == NULL) 166 166 goto failure; 167 167 168 168 pc_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(pc_fun_t)); 169 169 *fun = *fun_proto; 170 170 171 171 /* Add match ID */ 172 172 rc = ddf_fun_add_match_id(fnode, str_match_id, 100); 173 173 if (rc != EOK) 174 174 goto failure; 175 175 176 176 /* Set provided operations to the device. */ 177 177 ddf_fun_set_ops(fnode, &pc_fun_ops); 178 178 179 179 /* Register function. */ 180 180 if (ddf_fun_bind(fnode) != EOK) { … … 182 182 goto failure; 183 183 } 184 184 185 185 return true; 186 186 187 187 failure: 188 188 if (fnode != NULL) 189 189 ddf_fun_destroy(fnode); 190 190 191 191 ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name); 192 192 193 193 return false; 194 194 } … … 209 209 ddf_msg(LVL_DEBUG, "pc_dev_add, device handle = %d", 210 210 (int)ddf_dev_get_handle(dev)); 211 211 212 212 /* Register functions. */ 213 213 if (!pc_add_functions(dev)) { 214 214 ddf_msg(LVL_ERROR, "Failed to add functions for PC platform."); 215 215 } 216 216 217 217 return EOK; 218 218 } -
uspace/drv/platform/sun4u/sun4u.c
r3061bc1 ra35b458 154 154 { 155 155 sun4u_fun_t *fun = sun4u_fun(fnode); 156 156 157 157 assert(fun != NULL); 158 158 return &fun->hw_resources; … … 162 162 { 163 163 /* TODO */ 164 164 165 165 return false; 166 166 } … … 191 191 { 192 192 ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name); 193 193 194 194 ddf_fun_t *fnode = NULL; 195 195 errno_t rc; 196 196 197 197 /* Create new device. */ 198 198 fnode = ddf_fun_create(dev, fun_inner, name); 199 199 if (fnode == NULL) 200 200 goto failure; 201 201 202 202 sun4u_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(sun4u_fun_t)); 203 203 *fun = *fun_proto; 204 204 205 205 /* Add match ID */ 206 206 rc = ddf_fun_add_match_id(fnode, str_match_id, 100); 207 207 if (rc != EOK) 208 208 goto failure; 209 209 210 210 /* Set provided operations to the device. */ 211 211 ddf_fun_set_ops(fnode, &sun4u_fun_ops); 212 212 213 213 /* Register function. */ 214 214 if (ddf_fun_bind(fnode) != EOK) { … … 216 216 goto failure; 217 217 } 218 218 219 219 return true; 220 220 221 221 failure: 222 222 if (fnode != NULL) 223 223 ddf_fun_destroy(fnode); 224 224 225 225 ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name); 226 226 227 227 return false; 228 228 } … … 251 251 ddf_msg(LVL_ERROR, "Failed to add functions for the Malta platform."); 252 252 } 253 253 254 254 return EOK; 255 255 }
Note:
See TracChangeset
for help on using the changeset viewer.